GUILTY! A sobbing Weiner faces the judge and ten years in prison

NEW YORK (AP) — Former U.S. Rep. Anthony Weiner, whose penchant for sexting strangers ended his political career and sparked a probe that upended the presidential race, pleaded guilty Friday to a sex charge, tearfully apologizing for communications with a 15-year-old girl that he said destroyed his “life’s dream in public service.”

Weiner, who could go to prison, pleaded guilty to a single count of transmitting obscene material to a minor. He admitted exchanging online messages with the girl beginning in January 2015 and “sharing explicit images and encouraging her to engage in sexually explicit conduct.”

“I have a sickness, but I do not have an excuse,” he said.

In court, the 52-year-old former Democratic congressman paused repeatedly as he fought back tears and tried to compose himself. He said he knew the texting was “as morally wrong as it was unlawful.”

Former U.S. Rep. Anthony Weiner leaves Federal court, Friday, May 19, 2017, in New York. Weiner pleaded guilty to a charge of transmitting sexual material to a minor and could get years in prison. (AP Photo/Mary Altaffer)

Pleading to the charge, which requires him to register as a sex offender, could bring a sentence of up to 10 years. But Weiner is likely to serve a much shorter term if he is sentenced to prison. He signed a plea agreement with prosecutors in which he agreed not to appeal any sentence between 21 and 27 months in prison. His lawyer can request leniency at a sentencing scheduled for Sept. 8.

Wearing his wedding ring and a dark blue suit with a maroon tie, Weiner read from a prepared statement after U.S. District Judge Loretta A. Preska addressed him: “Tell me what you did, sir.”

He said he “compulsively sought attention from women who contacted me on social media” beginning with his service in Congress and continuing through the first half of last year.

“I engaged with many of them in both sexual and nonsexual conversation,” he said. “These destructive impulses brought great devastation to my family and friends and destroyed my life’s dream in public service. Yet I remained in denial even as the world around me fell apart.”

In this courtroom artist’s sketch, Anthony Weiner, right, accompanied by his attorney Arlo Devlin-Brown, reads a statement during a hearing, Friday, May 14, 2017 in New York Federal court. Weiner pleaded guilty to transmitting sexual material to a minor. (Jane Rosenberg via AP)

Weiner said he began getting mental health treatment in the fall, when he said he “came to grips for the first time with the depths of my sickness.” He said he continues to follow the treatment daily.

“I had hit bottom,” he said. “Through treatment I found the courage to take a moral inventory of my defects.”

Weiner apologized to “everyone I have hurt,” including the girl he “mistreated so badly.”

Finished speaking, he wiped his eyes with tissues.

Weiner was already in federal custody ahead of the hearing, which lasted less than a half hour. Afterward, he shook hands with prosecutors, telling them: “Thanks, guys. I appreciate your service.”

He then went down the courthouse elevator surrounded by his lawyers and court officers and left the building. He said nothing to reporters. His wife, Huma Abedin, was not in court.

Abedin, a top aide to Democratic presidential candidate Hillary Clinton last year, separated from Weiner in September after revelations he had sent more sexually charged messages online.

That same month, the FBI began investigating Weiner after the North Carolina girl told the news website DailyMail.com that she and Weiner had exchanged lewd messages for several months.

She also accused him of asking her to undress on camera. As part of his plea, Weiner agreed to forfeit his iPhone.

The investigation led FBI agents to seize his laptop computer, which led to the discovery of a new cache of emails that Clinton had sent to Abedin.

In late October, just days before the election, FBI Director James Comey stunned the country by announcing that his agency was reopening its closed investigation into Clinton’s handling of State Department business on a private email server so it could analyze the newly discovered correspondence.

That inquiry was brief. Comey announced shortly before the election that the new emails contained nothing to change his view that Clinton could not be charged with a crime. But Clinton partly blamed her loss to Republican Donald Trump on Comey’s announcement.

Weiner, who represented New York in Congress from 1999 to 2011, resigned after revelations that he was sending sexually explicit messages to multiple women.

He ran for New York City mayor in 2013 and was leading several polls until it was revealed he had continued his questionable behavior. His failed mayoral bid was the subject of the documentary “Weiner.”

[Featured Image: A teary U.S. Rep. Anthony Weiner, D-N.Y., addresses a news conference in New York, Monday, June 6, 2011. After days of denials, a choked-up New York Democratic Rep. Anthony Weiner confessed Monday that he tweeted a bulging-underpants photo of himself to a young woman and admitted to “inappropriate” exchanges with six women before and after getting married. (AP Photo/Richard Drew)/]

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.