Anthony Weiner pleaded guilty in a federal court to sending sexually explicit messages to a teenage girl. Photograph: (Reuters)
Weiner had resigned in 2011 after an explicit photograph was posted on his Twitter account
Former US Congressman Anthony Weiner on Friday pleaded guilty in federal court to sending sexually explicit messages to a teenage girl, ending an investigation into a "sexting" scandal that played a role in last year's US presidential election.
The count of transferring obscene material to a minor carries a maximum sentence of 10 years in prison. The plea deal with federal prosecutors included Weiner's agreement not to appeal any sentence of 27 months or less.
Wearing a navy-colored suit, maroon tie and his wedding band, Weiner, 52, entered his plea before US District Judge Loretta Preska.
The former Democratic congressman's promising political career imploded after a series of scandals involving inappropriate sexual exchanges with women online. US authorities last year began investigating reports that Weiner sent explicit messages to a 15-year-old girl in North Carolina.
Federal agents seized Weiner's laptop during the probe and discovered a batch of emails from his wife, Huma Abedin, a senior aide to Hillary Clinton, the Democratic nominee for president in 2016.
As a result, James Comey, then the director of the Federal Bureau of Investigation, announced in late October that the agency was reviewing the messages to determine whether to reopen its investigation into Clinton's handling of official correspondence.
Clinton, who was leading in national polls at the time, has blamed her loss to Republican Donald Trump in part on Comey's announcement, even though he said two days before the election in November that the review had uncovered no new evidence.
The controversy over Clinton's use of a private email server while she was US secretary of state dogged her throughout the campaign. Trump and other Republicans accused Clinton of endangering national security by exposing classified information to potential hacking.
In testimony to Congress two weeks ago, Comey said he felt "mildly nauseous" at the suggestion his actions may have swayed the election, but added that he had no regrets.
Trump fired Comey days later amid the FBI's probe into whether Trump's campaign colluded with Russia to defeat Clinton, an allegation he has vehemently denied.
The investigation into Weiner came to light after the Daily Mail, a British newspaper, published an interview with the teen whom Weiner allegedly sent the messages. It reported that the messages, which began when the girl was a sophomore in high school, indicated Weiner knew she was a minor.
Weiner, who represented parts of New York City for 12 years in the House of Representatives, resigned in 2011 after an explicit photograph was posted on his Twitter account. He claimed his account had been hacked but eventually acknowledged he had sent the image as well as inappropriate messages to several women.
Two years later, he announced a run for New York City mayor but dropped out of the race when more explicit messages became public.
Abedin announced her separation from Weiner last summer after a new round of explicit messages emerged that included an image of Weiner's crotch as he lay in bed with their young son.