Akram Joudeh was shot by police and critically injured when he attacked a detective with a meat cleaver, officials said. View Full Caption Essex County Department of Corrections

MIDTOWN — The man who sliced a city detective's face with a meat cleaver Thursday is a Jordanian national known to federal law enforcement officials after he used a wooden fence post to smash what he thought was an undercover NYPD car, DNAinfo New York has learned.

Akram Joudeh was arrested Sept. 8, 2013 near his then home in Elmhurst where he pulled up the post and started slamming a 2009 Chevy parked at 25th Avenue and 96th Street around 11:45 p.m., according to sources and court records.

He wailed at the car, cracking its front windshield, caving in the back window, slamming off both side view mirrors and denting every door and the hood.

After he was finally arrested by police, he told them, “I thought it was a detective’s car.”

In fact, the vehicle was owned by a Yonkers man with no connection to law enforcement.

Joudeh, now 32, pleaded guilty to criminal mischief and was sentenced to 60 days in jail.

It is not clear when he emigrated to the United States.

He was also previously arrested in Essex County, N.J., in August 2011. Details of that case, which was described as a minor offense by sources, were not immediately clear.

Although he had other minor arrests on his rap sheet and was listed as a “deportable alien,” federal authorities at the Department of Immigration and Custom Enforcement declined to place a “retainer” on him to have him deported.

Joudeh went on a cleaver-wielding rampage Thursday after his car was booted by the NYPD for being illegally parked near Penn Station, police said.

After a chase, he slashed an off-duty detective in the face before being shot by officers as many as 10 times.

The incident immediately drew a phalanx of anti-terrorism lawmen, especially since it mirrored an attack two years ago in Queens where another man, inspired by ISIS and wielding a hatchet, slammed an NYPD officer in the head and wounded several others.

Law enforcement officials say it is unclear whether Joudeh will face deportation as a result of Thursday’s clash, primarily because of a new city law.

In November 2014, Mayor Bill de Blasio signed two new laws enacted by the City Council that dramatically limit the city’s cooperation with federal immigration enforcement practices, except in instances where there are public safety concerns, and eliminated the feds' presence at all city facilities, including Rikers Island.

The move stemmed from a city officials' decision that federal authorities had been engaging in widespread deportation of immigrants across the country and they should restrict such actions here.

According to the Office of the Mayor's s website, Under Regulation 486A and 487A the city’s Department of Correction no longer honors requests by Immigration and Customs Enforcement to detain an individual for up to 48 hours beyond their scheduled release unless the agency provides a judicial warrant as to probable cause, and the individual has been convicted of a violent or serious felony within the last five years or is a possible match on the terrorist watch list.

The new law also limits information the city shares with ICE about people who are in the prison system and bars the feds from having an office or any operations at city facilities that involve civil immigration enforcement.

ICE continues to enforce its laws, its officials insist, and will continue to deport aliens convicted of crime, even without the city's full cooperation.