What to Know A man attacked an off-duty detective with a meat cleaver near Penn Station on Thursday afternoon.

The suspect had been fleeing cops with a cleaver in his hand after they caught him trying to remove a boot from his car.

Police fired 18 shots, hitting the suspect several times, after he gashed the off-duty officer with the cleaver.

UPDATE: Exclusive video shows chaos breaking out near Penn Station as officers sprint after suspect; wounded detective released from hospital

A man attacked an off-duty NYPD officer with a cleaver near Penn Station at the height of the evening rush hour Thursday, wounding the cop in the face before being shot at 18 times by police, officials say.

Police initially confronted 32-year-old Akram Joudeh near West 31st Street and Broadway as they caught him trying to remove a boot from his car, NYPD Chief of Department and incoming police commissioner Jimmy O'Neill said at a briefing Thursday evening.

Video obtained exclusively by NBC 4 New York shows a frustrated Joudeh trying to remove the boot, pulling tools from his packed car.

When police arrived, Joudeh pulled out an 11-inch cleaver from his waistband and began running toward Sixth Avenue, officials said. Officers chased after him, with others joining the pursuit along the way, and one uniformed sergeant deployed a stun gun to no effect.

The suspect continued running westbound on West 32nd Street toward Seventh Avenue, and in the middle of the block, mounted the front grill of a marked NYPD car, O'Neill said.

That's when an off-duty detective, who was walking to Penn Station to catch a Long Island Rail Road train home after work, saw the chase coming toward him, law enforcement officials told NBC 4 New York. He decided to engage and went to tackle the suspect.

The two struggled, and Joudeh hit him in the head with the cleaver, leaving a six-inch gash from the temple to the jaw, said O'Neill.

Three uniformed NYPD officers fired a total of 18 gunshots at Joudeh, striking him several times.

"I heard police from behind me screaming, 'Get down, get down, get down!'" said witness Jonathan Schneier. "I saw a deranged individual with a very large meat cleaver... Probably six to eight suspects engaged the suspect verbally, told him to drop his weapon."

O'Neill told reporters, "Keep in mind he had just attacked an off-duty officer who's got a six-inch gash on his face. He's got an 11-inch cleaver. They shot until the threat was stopped."

The off-duty detective, identified by sources as 16-year veteran Det. Brian O'Donnell, was taken to Bellevue Hospital, where he's listed in serious condition, officials said. Doctors are assessing the damage, and surgeons have said reconstructive surgery will be needed.

O'Donnell has spent most of his time on the force in the 19th Precinct, and became a detective in March 2015.

Two other officers were taken to the hospital with non-life threatening injuries from the encounter, though it's not clear how they got hurt.

Both Mayor Bill de Blasio and Police Commissioner Bill Bratton, who is finishing his last week on the job, visited the officers at the hospital. Bratton said the wounded detective was in good spirits despite the "significant injury."

Joudeh was also taken to Bellevue Hospital, and he's in critical but stable condition, said O'Neill. He has been moved to the operating room.

The attack happened near the busy Midtown commuter hub at the height of the evening rush hour. Bratton said the officers acted bravely in subduing the suspect in the crowded shopping and transit district, and that "sufficient shots" were fired to stop the "character running down the street waving a cleaver."

Witness Steven Coyle, who recorded video of officers shooting at the suspect, agreed.

"He was a threat to the officers and anyone in the area," he said.

Michael Palladino, president of the Detectives Endowment Association, said in a statement, "An incident like this proves that you are really never off duty. Our detective engaged the perpetrator because the suspect was carrying a meat cleaver and the detective was worried about the crowded conditions on the street given that it was rush hour full of residents, tourists and commuters."

Joudeh has 15 prior arrests, including one on July 27 after he was found carrying knives near a synagogue in the Manhattan Beach neighborhood of Brooklyn. His last known address was in Queens, though police say he may have been living in his car.

The other arrests stretching back to 2009 include charges for driving while impaired by drugs, criminal possession of a weapon, menacing with a weapon and criminal trespassing, sources said.

Two years ago, a hatchet-wielding man ambushed a group of NYPD officers in Jamaica, Queens, gashing a rookie cop in the head with the 18-inch ax. Two other officers shot and killed the suspect, Zale Thompson, on the street.

Thompson was a self-radicalized "lone wolf terrorist," police officials said after the attack.

In Thursday's incident, a federal official told NBC News "based on what we know of how this started, and on his priors, we don't currently think this was an act of terrorism."

Another law enforcement source told NBC 4 that investigators actively looked into whether Joudeh had any interest in or connection to terror planning after he was caught outside the synagogue in July with the knives. But they did not find any evidence of any radicalization.

Joudeh's former neighbors in Elmhurst described him as troubled, constantly fighting with his two roommates and sometimes getting visits from police. One woman who asked not to be identified said he once got into an altercation with a family member, and during the fight, broke the front glass door of the building's entrance.