Former New York congressman Anthony Weiner has tearfully pleaded guilty to sending obscene material to a minor.
The charge stems from sexually charged text messages he exchanged with a 15-year-old girl last year.
He stepped down from his congressional seat in 2011 over a series of sex scandals and was again exposed during his 2013 bid for New York City mayor.
The judge reportedly told Mr Weiner he will have to register as a sex offender.
Mr Weiner entered his plea at a Manhattan court on Friday morning and was released on bail, pending sentencing.
He reportedly agreed not to appeal any sentence between 21-27 months in prison, but could face up to 10 years.
Mr Weiner reportedly cried in court while apologising to the girl he sexted with, saying: “I have a sickness, but I don’t have an excuse”, according to local media.
Acting Manhattan US Attorney Joon H Kim praised the work of the FBI and the Special Victims Division of the New York City Police Department after the announcement.
“Weiner’s conduct was not only reprehensible, but a federal crime, one for which he is now convicted and will be sentenced,” Mr Kim said.
Mr Weiner’s sexting scandal made headlines during last year’s US presidential election.
During an investigation, FBI officials found emails on Mr Weiner’s laptop from his ex-wife, Huma Abedin, who was a top aide to Democratic candidate Hillary Clinton.
An FBI investigation into Mrs Clinton’s private use of email while she was secretary of state was closed after officials said nothing incriminating was found.
The FBI began investigating Mr Weiner last September after the Daily Mail reported that he exchanged lewd messages with a teen from North Carolina for several months.
The newspaper, which did not identify the girl, suggested that Mr Weiner knew she was under age at the time.
The girl’s father told the Daily Mail after the deal was announced: “I don’t know if it’s justice… Just because he’s pleading guilty doesn’t mean he’s going to do a bit of time.”
The girl also accused him of asking her to undress on camera.
A month earlier, Ms Abedin announced she was separating from her husband after a report emerged that he allegedly sent a photo of himself in his underpants with his toddler son nearby.
The New York Post reported that Mr Weiner sent sexual messages along with the alleged photo to an unidentified woman in 2015.
Once a rising Democratic star, Mr Weiner stepped down from Congress in June 2011 after a graphic image sent from his Twitter account went public.
Initially claiming his account was hacked, he eventually confessed to having lied.
He also admitted indulging in explicit online exchanges with at least six other women and pledged to seek therapy.
Mr Weiner attempted to revive his political career in 2013 by running for mayor of New York.
But his campaign imploded amid reports of further graphic online messages.
His next court appearance is scheduled for 8 September.