Australian police sealed off streets and warned the public to keep away from that area after the incident on Friday, reported Reuters quoting police and media.
A BBC report, quoting a police statement, said the shooting took place around 4:30pm local time.
The statement said a police officer had used his weapon to stop the gunman who had opened fire.
Quoting the Daily Telegraph newspaper, Reuters said a man had fired on the building, hitting a police employee before being shot dead by police.
The fatal shooting took place barely 24 hours after Australia postponed its cricket team's tour of Bangladesh citing threats of attack on ‘Australian interests’ by militants.
In December, two hostages were killed when policed stormed a central Sydney cafe to end a 17-hour siege.
The Australian Broadcasting Corp said Friday's shooting was not thought to be terror related, but police were yet to confirm.
The gunman and the victims were yet to be identified.
The BBC report said Vijay Dantu, a resident of the building situated on the opposite of the New South Wales state police headquarters, told ABC News that he had heard several gunshots.
"I was doing some work at my home and there's a gunshot and I thought it was a tyre puncture," he said. "Then all of a sudden two more shots came."