Two people have been killed in a shooting outside a police building in Sydney, Australia.

New South Wales Police say the gunman, who witnesses say was dressed in black, had approached a police employee and shot him dead at "point blank range".

The victim, an IT worker, had been leaving work at the Parramatta-based headquarters at about 4.30pm local time when he was killed.

The gunman then fired at several Special Constables inside the police building.

Three of them came outside and they were joined by several police officers, killing the gunman in the exchange of fire, according to NSW Police Commissioner Andrew Scipione.

Mr Scipione said in a press conference that police were not ruling out any possible motive for the attack, including terrorism but he praised the police officers, saying they had "exhibited enormous bravery".

He added: "There’s no way you can describe the feeling you have… this man was simply leaving work this afternoon, he was gunned down.

"He was murdered on this very street, it’s a terrible feeling."

Real estate agent Edwin Almeida said he heard gunshots and saw the man in a black gown pacing and waving a gun outside the police centre, which is in the suburb of Parramatta.

Mr Almeida said his frightened staff ran into their office and heard three to four gun shots.

He said: "We looked out the window, saw security guards and what appeared to be a plain clothes police officer with gun drawn and pointing at the person that was now lying on the floor surrounded by a pool of blood."

A caller to the Ben Fordham program on Australian radio 2GB said they could see two bodies, covered with sheets.

"There are two bodies on the ground and we are just being told to move away to give police room," the caller said.

Another witness said: "I saw the guy dressed in black on the pavement," he told the radio host, "blood everywhere."

A police source told Australia's Fairfax Media that there was increased "chatter" monitored in the past week relating to a possible attack on the Parramatta headquarters, which is home to the homicide, drugs, Middle Eastern organised crime and gangs squads.

He added that every officer had been ordered to wear their guns on them at all times this week, even while at their desks.

It is understood police became aware of a plans for a possible attack on Parramatta headquarters 12 months ago.

Australia has been on heightened alert for attacks by home-grown Islamist radicals since last year and in December two people were killed when police stormed a central Sydney cafe to end a 17-hour siege.