The officer was taken to St Vincent’s Hospital with non-life-threatening injuries and is in stable condition.
The alleged attacker was arrested at the scene and taken to Royal Prince Alfred Hospital where he is undergoing assessment under police guard.
He is known to police but does not have a history of mental illness recorded on the police database or a “substantial” criminal record, Det Supt Fileman said.
“This was very much an isolated incident and there is no further threat to the public,” he said.
“He will be released from hospital shortly and he will be facing very serious charges.”
It follows a series of high-profile knife crime incidents including an attack at Sydney’s Bondi Junction shopping centre where six people were fatally stabbed, and another attack on a bishop who was stabbed while delivering a sermon at a Western Sydney church.