The sexting scandal that Hillary Clinton believes affected the outcome of November’s presidential election will come to a close today.

Former Congressman Anthony Weiner plead guilty Friday to charges of transferring obscene materials to a minor, a charge that carries a sentence of zero to 10 years of jail time, the New York Times reports. Weiner could potentially avoid jail time, although he’ll be required to register as a sex offender. The sentence will be determined by a federal judge.

The F.B.I. opened an investigation into Weiner after the Daily Mail reported that Weiner had had contact with a 15-year-old girl from North Carolina. They allegedly exchanged suggestive messages and images over text message and social media.

The investigation into the then-51-year-old’s relationship with the girl landed a trove of emails between Weiner and his estranged wife, Huma Abedin, a principal aide to then-candidate Hillary Clinton, in the F.B.I.’s lap.

As a result of their investigation into Weiner’s sexting, the bureau opened a new investigation into Clinton’s use of a private email server in October of last year. Then-F.B.I. director James Comey announced the existence of the inquiry 11 days before the election.

Earlier this month, Clinton blamed Comey’s investigation into her emails, along with the posting of campaign manager Podesta’s emails on Wikileaks by Russian hackers, for her loss.

Weiner’s sexting ended his congressional career and derailed his 2013 mayoral campaign.