A civilian police employee was "callously murdered" at close range as he left work and had been deliberately targeted, state police commissioner Andrew Scipione said.
The gunman, who was killed by police fire, is yet to be identified.
Commissioner Scipione declined to speculate on a motive for the attack.
The incident occurred at about 16:30 local time (06:30 GMT).
There was no evidence to link the incident to terrorist-related activity, he said.
The victim has not been named.
A critical incident team will now investigate all circumstances surrounding the incident, police say.
Vijay Dantu, who lives opposite the police building,  told the Australian Broadcasting Corporation he heard multiple gunshots.
"I was doing some work at my home and there's a gun shot and I thought it was a tyre puncture," Mr Dantu said.
"Then all of a sudden... two more shots came."
After firing a single shot at the victim, the gunman fired on other officers and was killed when they returned fire, police said.
They believe the gunman was acting alone.
Two people have been killed in a shooting outside New South Wales state police headquarters in western Sydney, Australian police say.