A stricken Anthony Weiner erupted in sobs Monday as a federal judge in Manhattan rejected the former Democratic congressman’s bid for leniency and sentenced him to 21 months in prison for sexting with a 15-year-old North Carolina girl and asking her to undress for him online.

Weiner first choked up as he asked to remain free to pursue treatment, and then bowed his head and began weeping after U.S. District Judge Denise Cote said the sexting addiction that twice destroyed his political ambitions made him hard to trust, and jail was needed to deter others.

“The difficulty here is that this is a very strong compulsion,” said Cote. “So strong that despite the destruction of his career on two occasions he continued the activity. . . . He has made great strides but it will remain a challenge for years to come.”

Weiner, 53, whose marriage to top Hillary Clinton aide Huma Abedin had once put him near the apex of political power and celebrity, left Congress in 2011 and then torpedoed a New York City mayoral campaign in 2013 due to earlier sexting scandals involving adult women.

His sexting with the high schooler last year led to the discovery of new emails from Clinton that reopened an FBI probe of her handling of classified materials, damaging her campaign in the final stages of the presidential race.

Weiner pleaded guilty in May to transmitting obscene material to the girl during Skype and Snapchat, and told Cote he had been a “very sick man for a very long time” but treatment — from a psychotherapist and Sex Addicts Anonymous — was working.

advertisement | advertise on newsday

“I’m not asking that you trust that my recovery is real,” said Weiner, pleading to stay with his son Jordan, 5. “I ask you for the opportunity to prove that it is real. I ask the opportunity on probation to keep leading my smaller, healthier life each day, to keep getting better, to be of service.”

But Cote said she had to send a message that would deter more dangerous predators from trolling the internet in search of child targets.

Anthony Weiner, the former Democratic congressman whose sexting scandals ended his political career, exits the federal courthouse in Manhattan after pleading guilty to charges in May 2017. Photo Credit: Craig Ruttle

“Because of defendant’s notoriety there is intense interest in this prosecution, in his plea, and his sentence, and so there is the opportunity to make a statement that could protect other minors,” she said.

In a sad scene after the judge left, a stunned Weiner sat with his head down weeping for several minutes as the court was cleared. Abedin, who is in divorce proceedings, wasn’t present. When Weiner left with lawyer Arlo Devlin-Brown they didn’t talk and hustled into a waiting car.

Later, Devlin-Brown said Weiner was “disappointed” and criticized Cote’s deterrence rationale. “We certainly hope this public service message is received, but it has resulted in a punishment more severe than it had to be given the unusual facts and circumstances of this case,” he said.

At the time of his exchanges with the teen in early 2016, Weiner also was engaged in texting exchanges with 19 adult women, lawyers said. He asked the girl to “touch herself” while naked and described “what he would do to her if she were 18,” according to court papers.

Investigating the exchanges last fall, the FBI found emails from Abedin on Weiner’s laptop that related to its closed probe of Clinton’s State Department email practices. FBI director James Comey reopened that case – an action Clinton partially blames for her loss – before ending it just 2 days before the election.

Weiner faced up to 10 years in prison, but prosecutors had agreed as part of a plea bargain to limit their request to 21 to 27 months. Both sides agreed Weiner is not a pedophile, although the government said he admitted an attraction to teen-themed porn.

advertisement | advertise on newsday

Devlin-Brown argued that the case was unusual because Weiner made no effort to meet the teen and she had initiated their texting in hopes of making money off a scandal. But Cote — who kept sealed letters from the girl and her father — dismissed questions about her behavior.

“I don’t think that the complexity of the victim’s motives . . . or the fact that she initiated this contact are relevant,” the judge said.

Weiner has to surrender no later than Nov. 6 to begin serving his sentence, and will be on probation for 3 years after release with intensive monitoring of computer and social media use. He was also fined $10,000 and will have to register as a sex offender.

He will be eligible for release after about 18 months, and Devlin-Brown said Weiner hopes to go to a prison camp in Pennsylvania instead of the high-security federal jail in Brooklyn near his home. Cote agreed to not follow her usual practice of recommending a facility close to home.