A man and woman have been arrested after allegedly opening fire on police in Sydney's inner west.

The 27-year-old man is accused of using a shotgun when officers chased the pair down an alleyway in Lewisham.

View photos Police say they began pursuing a man and a woman in the early hours of Wednesday morning after spotting them in a stolen vehicle in Petersham. Photo: 7News More

Police say they began pursuing a man and a woman in the early hours of Wednesday morning after spotting them in a stolen vehicle in Petersham.

They lost sight of the car but found it again shortly afterwards and as the driver attempted to run away down an alley, he turned and fired a shot at police.

View photos The 27-year-old man is accused of using a shotgun when officers chased the pair down an alleyway at Petersham. Photo: 7News More

View photos A man and woman have been arrested after allegedly opening fire on police in Sydney's inner west. Photo: 7News More

The shot went into a door as they tried to gain entry to a unit block.

There was a resident inside but they were not hurt.

View photos The driver attempted to run away down an alley. Photo: 7News More

Police had been following a stolen Lexus when the couple jumped out and fled on foot.

Both the man and the woman are now in custody.

The woman suffered minor injuries.