Witnesses screamed in terror as they watched cops shoot dead a crazed gunman who sprayed shotgun rounds at officers outside a Sydney police station last night.

The dramatic shootout unfolded when the man, brandishing a 12-gauge shotgun, opened fire on a police car outside Penrith station on High Street at 9.35pm on Wednesday.

Video footage posted online showed officers slay the gunman in a hail of bullets, firing several shots to his chest before he fell to the ground.

'This is unfolding in front of my eyes… oh my God, oh my God,' the woman filming the short clip gasped.

'I'm telling you this is happening, this is unfolding in front of my eyes... He is shooting the police! Let's go, I am scared.'

Terrified witnesses have been left shaken up after watching police shoot a crazed gunman dead after he sprayed two police stations with bullets. Pictured is the gunman

There were unconfirmed reports that a second person may be involved in the attacks but police are not looking for anyone else. Riot police are pictured near Penrith station

An injured police officer (pictured) was taken to Westmead Hospital in a stable condition

Sydney shootings: A timeline 8.45pm: Shots are fired into a home on Quakers Road, Marayong. Shotgun shells were seen scattered outside the property. 9.15pm: Gunman sprays bullets into St Marys Police Station. 9.35pm: A car stops outside Penrith station, with a man wielding a pump-action shotgun opening fire. 9.35pm: The gunman is shot dead by police. Advertisement

The shooter's attack began 8.45pm when shots were fired into a home in Marayong - but no-one was injured.

The gunman is then believed to have driven to St Mary's Police station where he fired three shots into the front of the building at 9.15pm, again injuring no-one.

At 9.35pm he stopped outside Penrith police station.

The man, dressed in black and wielding a pump-action shotgun, approached a police car and fired several shots at two officers inside.

Police returned fire and killed him with a hail of bullets.

Terrified witnesses from buildings opposite yelled and screamed in shock.

One officer was injured by a shotgun pellet to the back on the head. He was taken to hospital with non life-threatening injuries.

Some other officers sustained cuts and grazes and were taken to hospital for treatment.

At the time of the shootings there were unconfirmed reports another gunman may have been involved.

But at 6am on Thursday police said they were not looking for anyone else.

Officers investigating the motive for the attack have said it was not terrorism.

There are unconfirmed reports the shootings may have been retaliation for an incident involving police earlier on Wednesday.

The shooter's attack began 8.45pm when shots were fired into a home in Marayong - but no-one was injured

Early investigations suggest the two shootings may be linked to an incident where a number of shots were fired into a home in Marayong (pictured)

Shotgun shells are seen scattered outside the property in Marayong on Wednesday night

Footage showed an officer being wheeled out of an ambulance, before he was taken to Nepean Hospital

On Thursday morning Penrith Police station remained closed with a crime scene in place

Witnesses from the Aussie Arms pub, nearby Penrith Police Station, told the Seven Network they saw a volley of gunfire involving around 25 shots.

The witnesses said they saw police drag a dead man into the station.

Another witness recalled to 10 Daily the moment police confronted the shooter at Penrith station.

'They started yelling ''drop the gun, drop the gun'',' the witness said.

The witness said police fired at the gunman after he refused to put down his weapon.

The investigation is in its early stages but police don't believe the shootings are terror-related.

Penrith Police Station and St Marys Police Station will be closed until further notice.

NSW Police issued a statement at 2am on Thursday that said shots were fired into St Marys Police Station at 9.15pm