Former congressman Anthony Weiner is facing a federal investigation after reports that he exchanged sexually explicit text messages with a 15-year-old girl, sources said Thursday. 

The office of the U.S. attorney for the Southern District of New York has issued a subpoena for Weiner’s cellphone and other records, and the FBI and NYPD have opened preliminary investigations, the sources said. 

A law enforcement official confirmed that NYPD detectives were looking into the case. 

The allegations of sexting with a minor come from a Wednesday Daily Mail report in which the British tabloid said it had evidence that Weiner had been communicating with the 15-year-old since January. 

Weiner told the tabloid, “I likely have been the subject of a hoax” and said he had “no one to blame but me.”

Authorities in North Carolina, where the 15-year-old reportedly lives, are also involved in the investigation — with the U.S. attorney’s office based in Charlotte “reviewing all materials relevant to the matter,” according to a spokeswoman.

The report is the latest scandal for Weiner. 

His wife, top Hillary Clinton aide Huma Abedin, announced last month that the two would separate after a shirtless photo surfaced of Weiner in his underwear lying near the couple’s young son. 

Weiner resigned from his seat in the House of Representatives in 2011 after his first sexting scandal. Sexually suggestive text messages also led to the collapse of his 2013 New York City mayoral campaign. 

The man who defeated Weiner, Bill de Blasio, on Thursday called the latest revelations “horrible.”

“It’s not a secret: Anthony obviously has a real problem that needs treatment,” de Blasio said at an event at a middle school. “And all I can say is that I hope he will pursue the treatment he needs and stick with it until the issues are addressed.”

With Robert Kessler and Anthony M. Destefano