A top de Blasio administration lawyer infuriated cops by tweeting about how the city failed NYPD “chokehold” victim Eric Garner — even as the investigation into his death remains open.

“RIP Eric Garner,” wrote Ian Bassin, a deputy counsel who earns $140,000 a year. “You deserved so much more from our City. We will and we must do better.”

The premature July 19 posting on Bassin’s personal Twitter page enraged cops, who are under fire over the death even before an official autopsy report.

“That is crazy. This administration is filled with a bunch of liberal loonies,” said a police source. “I don’t understand how someone who represents the mayor could go public with a statement like that without the autopsy report.”

The tweet came just two days before Mayor Bill de Blasio stressed the need to let the investigation take its course before rushing to judgment. “All sides need to be heard and all evidence looked at,” he said Monday in Italy.

On Wednesday, City Hall responded to questions about the tweet by saying, “The mayor and police commissioner have made the administration’s position on this tragic incident clear.” Bassin declined to discuss the tweet.

Garner, a 350-pound asthmatic diabetic, died struggling with police July 17 on Staten Island when they tried to arrest him for peddling “loosie” cigarettes.

He had more than 30 prior arrests, including for assault, and argued with cops during the cigarette incident, repeatedly resisting their efforts to cuff him.

Officer Daniel Pantaleo placed Garner, 43, in an apparent chokehold before Pantaleo and fellow cop Justin Damico dragged him to the ground. Garner went into cardiac arrest and died on the way to a hospital.

RIP Eric Garner. You deserved so much more from our City. We will and we must do better. — Ian Bassin (@blue24fox) July 19, 2014

An initial police report noted that two supervising sergeants failed to tell Internal Affairs about the chokehold, but sources said the sergeants were unaware of the chokehold because they got to the scene after Garner was already on the ground, said a high-ranking police source.

Sgts. Kizzy Adonis and Dhanan Saminath were never informed by the officers about how they took down Garner, who was unconscious but still breathing, the source said.

Internal Affairs detectives are still trying to determine whether Pantaleo applied a forbidden chokehold or if it was a “submission” hold, which may fall within departmental guidelines.

Authorities are also still awaiting the final results of Garner’s autopsy, which could take up to two weeks while the medical examiner performs toxicology tests.

Meanwhile, Internal Affairs is investigating another apparent police chokehold, caught on video in a Harlem subway station.

Cops saw Ronald Johns, 23, go through a service-entrance gate at the 125th Street/Lexington Avenue station at about 5 p.m. July 14, and struggled to arrest him when he refused to show ID, officials said.

A video shows an officer punching him in the face and ­using either a headlock or chokehold to get him under control.

Additional reporting by Kirstan Conley