It was “un-American” for the NYPD to subpoena a New York Post reporter’s social media data, according to a Bronx lawmaker, who is questioning this week whether the controversial move was even legal.

“The NYPD’s heavy-handed wielding of subpoena power, under false pretense, demonstrate a disregard for the First and Fourth Amendments, not to mention the New York State shield laws, which are designed to preserve the confidentiality that lies at the core of investigative journalism,” Councilman Ritchie Torres wrote in a letter Monday to Police Commissioner Dermot Shea.

“Freedom of the press is so sacred in America that the records of a journalist should rarely, if ever, be seized, and should never be seized without the most rigorous form of judicial review,” he continued.

News of the subpoena seeking Twitter account data for Post Police Bureau Chief Tina Moore broke last month amid a top-down effort to close the spigot on department leaks. In documents reviewed by The Post, the department tried to use the post-9/11 federal anti-terror law The Patriot Act.

The top cop conceded last week that the department was wrong in issuing the subpoena — but kept the door open to issue future subpoenas, despite the mayor’s previous vow that the NYPD “will not do that going forward.”

The legal papers sought broad account data for Moore’s account @Tinamoorereport between Oct. 9 and Oct. 14. One expert said that info could allow the NYPD to essentially track the reporter’s movements over those days.

Shea said the subpoena was connected to an internal investigation of who in the department leaked gory crime scene photos to Moore, but he wasn’t aware of the order at the time.

He did, however, defend internal affairs investigators last week, saying he understood why they would start their investigation with Twitter since the photos were posted there.

Torres said the apology, which only came after public outrage, fell short.

“[W]hat the public needs is more than a gesture of contrition,” the councilman wrote.

Torres called on Shea to explain how the order was issued for a private citizen’s records, especially a journalist, without judicial review — and for an explanation of why it cited an anti-terror law.

“The Police Department has an obligation to promulgate new policies aimed at preventing and punishing the overzealous use of administrative subpoena power. What do administrative subpoenas have to do with counterterrorism, the purpose of the Patriot Act?” the councilman wrote, calling the subpoena “an act of intimidation” that “one would expect from a police state, not a municipal agency.”

“There is something not only unlawful but deeply un-American and unpatriotic about weaponizing the Patriot Act to seize the records and suppress the sources of a free press.”

A spokeswoman for the NYPD pointed to Shea’s comments last week when asked about the letter, saying the commissioner addressed the councilman’s concerns.

But the spokeswoman refused to comment on the legality of the department using an administrative subpoena to obtain the data of someone who is not employed by the department, without any judicial oversight.

This wasn’t the first time the NYPD tried to subpoena records by going around a judge, the councilman also notes in the letter.

In January 2018, the department issued a request to Google to turn over all of a teen’s search history as part of an internal investigation — but the NYPD backed off when it was challenged in court.

“The department withdrew their subpoena on a Thursday and showed up with a search warrant on a Friday,” the teen’s lawyer, Martin Stolar, told The Post. “But that’s the point. That’s how it’s supposed to work. The NYPD has no power to subpoena.”

The case against the teen, who was only identified as “K.Q.,” has since been sealed, the attorney confirmed.

The NYPD withdrew its subpoena for Moore’s Twitter data after The Post’s attorneys contacted the department.