NEW YORK - An off-duty NYPD detective injured by a man wielding a meat cleaver on a busy Manhattan street was released from the hospital Friday as police continue to investigate what prompted the attack.

Officer Brian O'Donnell, a 16-year veteran of the force currently assigned to the 19th Precinct, was applauded by fellow officers while leaving Bellevue Hospital.

Twitter video captured the wild scene as it erupted Thursday near West 31st Street and Broadway in Midtown.

Police say they initially received a call that 32-year-old Akram Joudeh was trying to remove a parking boot from his car.

When the officers arrived, they say Joudeh pulled an 11-inch meat cleaver from his waistband and ran away.

Police chased Joudeh to 32nd Street and Sixth Avenue and tried to taser him, but that didn't work.

The NYPD says he attacked Detective O'Donnell after climbing onto a police car.

"As everybody was running away from this man with the meat cleaver, who was running after him? Nobody but NYPD cops. And we had a very brave off-duty detective from the 19th Precinct chose to intervene," said Police Commissioner James O'Neill.

"This is a true example that you're never really off-duty in this city. Here's a situation where a man is carrying a meat cleaver and the detective is well aware of the fact that whether the uniformed police are chasing him or not, he poses a great threat to thousands of New Yorkers," said Detectives' Endowment Association President Michael Palladino.

Officers fired 18 shots at Joudeh and struck him several times.

He was taken to the hospital in critical condtion.

Two other officers suffered minor injuries from bullet grazes.

Police say bullets grazed one officer on his ear and the other on his side. 

They are both expected to recover.

Joudeh is described by police as an emotionally disturbed person who has been arrested more than a dozen times.

In July, police say he was arrested after being found with two knives in his car.  

Police say three years ago, Joudeh used a wooden fence post to smash up a car in East Elmhurst that he thought belonged to an NYPD detective, but it didn't.

Joudeh was arrested and later pleaded guilty to criminal mischief and sentenced to 60 days in jail.

He had been scheduled for an immigration hearing next month.