Minutes ago, Anthony Weiner pleaded guilty to transmitting sexual material to a minor, which could put him in prison for over two years.

Weiner agreed not to appeal any sentence between 21 and 27 months in prison, according to Newsday.

The FBI began investigating Weiner in September after a 15-year-old North Carolina girl told a tabloid news site that she and the disgraced former politician 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 top aide Huma Abedin, Weiner’s wife.

Citing the newly discovered Weiner emails, the FBI said last October that it was reopening its probe into the security of Clinton’s emails during her time as secretary of state, but it closed the probe again in November without taking any prosecutorial action.

Weiner, a Brooklyn native, was elected to Congress in 1998, filling the seat from a Brooklyn/Queens district that was vacated by Chuck Schumer, who won a Senate seat that year.

Before that, he was a staff aide to Schumer for six years and then served in the New York City Council from 1992 to 1998.

He resigned from Congress in June 2011 after one sexting scandal and made a failed run for mayor in 2013.