An alleged child sex offender has been shot dead by police in a Sydney pub after twice stabbing the officer attempting to arrest him.
The senior officer, named in media reports as state crime command Detective Sergeant John Breda, was knifed in the chest and abdomen after police went into the beer garden of the busy Maroubra Junction Hotel to arrest Nick Newman on Friday afternoon.
Newman, 33, was shot by two other officers and died at the scene.
Sgt Breda, 45, was taken to St Vincent's Hospital and remains in a critical condition after undergoing emergency surgery.
"It was a relatively routine situation they were in today and unfortunately that has escalated and ended in this very serious outcome," Assistant Commissioner Mark Walton told reporters in Maroubra on Friday.
"It's fair to say this happened very quickly as the officers approached this man."
The officers who shot Newman were "traumatised," according to Mr Walton, who said police were "very concerned" about the injured detective sergeant's condition.
A critical investigation has been launched which will be subject to an independent review.
Police on Thursday said they were searching for Newman who was known to frequent the Sydney CBD, Redfern and the Nepean area.
He had been scheduled but failed to appear in Penrith Local Court the previous day.
A witness walking to the gym across the road from the Maroubra pub as the drama unfolded told AAP he'd been startled as numerous police cars rushed past with sirens blaring.
Pedro Casemiro said he stepped onto Maroubra Road as scores of officers stormed into the pub.
"Ten seconds later a lot of policemen started running around the hotel," he said.
"The guys at the hotel said someone is shot, someone is dead."
A nearby business owner said one of his customers had told him "someone has been shot dead" after hearing the gunfire.
Businesses were closed in the immediate area, with parts of Maroubra Road taped off several hours.
One witness said she heard four or five gunshots.
"I look up, I go outside, there's all these sirens there and I see a guy come out in handcuffs and another guy in a stretcher," the woman told 2GB.
NSW Police Association president Scott Weber described the incident as "another tragedy".
"Everyday when we go out onto the street to protect the people of NSW, we realise we may not be coming home."