After the battle in the Ministry, Professor Dumbledore sends Harry to Hogwarts using a Portkey. The Portkey is a part of the statue in the "Fountain of magical brethern" in the atrium of the Ministry of Magic, and sends Harry to the Hogwarts headmaster's office. Quoting Harry Potter and the Order of the Phoenix chapter 36.
He [Dumbledore] walked away from the pool to the place where the golden wizard's head lay on the floor. He pointed his wand at it and the muttered, ‘Portus.’ The head glowed blue and trembled noisily against the wooden floor for a few seconds, then became still once more.
‘Now see here, Dumbledore!’ said Fudge, as Dumbledore picked up the head and walked back to Harry carrying it. ‘You haven't got authorization for that Portkey! You can't do things like that right in front of the Minister for Magic, you – you –’
Did Professor Dumbledore set up the Portkey then and there? Or was it instead a Portkey set up previously, and he merely activated it with that “Portus” incantation?
Hogwarts had magical protection set up so you can't easily enter using a Portkey. If Professor Dumbledore quickly set up the Portkey right there and then, how did he get past the protection? If the Portkey had been set up previously, did they make sure it couldn't be misused to breach the security of Hogwarts?
See also Who can make a portkey that goes into Hogwarts? and In Harry Potter and the Order of the Phoenix it seems Dumbledore makes a portkey that only Harry can use. Am I interpreting this correctly?