A man who became enraged when he found a boot on his car near Penn Station on Thursday attacked cops with a meat cleaver — seriously wounding one — before officers shot him in a flurry of 18 bullets, police said.

Akram Joudeh, who was living in the car, struck Detective Brian O’Donnell with the 11-inch blade, leaving a gash from his temple to his throat, Police Commissioner Bill Bratton said.

Joudeh, 32, who has numerous arrests, was left splayed out in a pool of blood on West 32nd Street near Broadway.

He had flown into a rage after discovering the clamp — used to immobilize a car found with an excess of outstanding tickets — fitted on a wheel of his white Nissan Altima, which was parked on West 30th Street and Broadway.

He tried to bash the boot off his tire with a hammer.

“I saw him trying to break the boot,” said Tusar Paul, 24, who works across the street.

“He was doing it for about an hour. He was using a hammer. Other people were telling him to stop, that’s illegal.”

When officers tried to talk to him, around 5 p.m., Joudeh pulled the cleaver from his waistband and started swinging, law enforcement sources said. He then ran toward Seventh Avenue.

“You have a character running down the street waving a meat cleaver,” Bratton said.

When he refused to drop the implement, a sergeant stunned him with a Taser, but Joudeh continued running west, police said.

Near Seventh Avenue, Joudeh climbed onto an NYPD squad car but was tackled by O’Donnell, who sustained a 6-inch gash during the mayhem, police said.

O’Donnell — who busted “Sopranos” star Robert Iler for carrying a pot pipe in 2002 — was taken to Bellevue Hospital, where he underwent surgery Thursday evening.

He was off duty at the time of the incident.

Two other officers were taken to the hospital with minor injuries. They were released Thursday night.

Joudeh also was taken to Bellevue, where he was listed in critical condition.

Witnesses described a chaotic scene.

“I saw a mob of people running for their lives, screaming coming from the street, and I let in as many people as I could and locked the door and tried to keep as many people safe as possible,” said Leroy Kelly, a 54-year-old security guard at Manhattan Mall.

“I’m a little traumatized. I’m just trying to do my job and make people safe.”

Joudeh has a history of raging at police officers. In 2013, he was arrested and charged with criminal mischief for smashing a car with a wooden fence post.

“I thought it was a detective’s car,” he allegedly told cops.

Former neighbors called him unstable and dangerous, and noted his animosity toward the police.

“He was crazy and weird,” said J.J. Williams, who lived near Joudeh’s home in Elmhurst, Queens. “I always knew something was wrong with him.”

Williams said there were altercations at the home and that the cops had to get involved.

“Neighbors calling the police on him,” he said. “He was like, ‘F- -k the cops.’ He don’t like police.

“One day, they [cops] had to throw him on the floor. It’s not the first time they ever came here and hauled him away.”

But people at the St. Francis of Assisi food pantry in Midtown, where Joudeh would visit, remembered him as mild-mannered despite his suffering from depression.

“He’s a peacemaker. He had no trouble with anyone,” a homeless man said. “He kept to himself.”

Another homeless person said Joudeh would “stay to himself and sleep in the car.

“He seemed like he was going through something, like depression,” the man said.

Additional reporting by Joe Marino, Kenneth Garger and Sophia Rosenbaum