Former congressman Anthony Weiner has pleaded guilty to transmitting sexual material to a 15-year-old girl and faces years in prison.

In a court in New York, Weiner agreed Friday not to appeal any sentence between 21 and 27 months in prison. The judge told him he would have to register as a sex offender.

Weiner cried as he apologized to the teenager with whom he exchanged sexually explicit texts.

“I have a sickness, but I do not have an excuse,” the former Democratic congressman said.

The FBI began investigating the Democrat in September after the girl in North Carolina told a tabloid news site that she and Weiner had exchanged lewd messages for several months. She also accused him of asking her to undress on camera.

The investigation of his laptop led to the discovery of a cache of emails from Democratic presidential nominee Hillary Clinton to her aide Huma Abedin, Weiner’s wife.

In 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 election loss to Republican Donald Trump on Comey’s announcement.

In court Friday, Wiener plead guilty and responded steadily to more than a dozen administrative questions as he stood before a packed courtroom.

His composure shattered when he began reading a prepared statement confessing to his crimes. Six words into the statement, he broke down in tears.

He paused, then continued to read out an emotional confession, that also included repeated apologies to the victim and for causing a “great devastation to my family and friends”.

He said the “world around me fell apart” amid the scandal, which was extensively documented by the media. He apologized to the 15-year-old who he shared sexual images with “as I continue to do with adult women”.

“This fall, I came to grips for the first time with the depths of my sickness,” Weiner said. He said he entered a treatment program which he adheres to to this day. He said that he has been forced to confront his “defects”.

The Guardian