Former US congressman Anthony Weiner has been sentenced to 21 months in prison for sexting with a 15-year-old girl in a case which may have contributed to Hillary Clinton's presidential loss.
The former Democratic congressman from New York had faced up to 27 months in jail after his guilty plea to one charge of transferring obscene material to a minor.
Prosecutors said he broke the law by having illicit contact with a 15-year-old girl using Skype and Snapchat.
Weiner's sexting habit destroyed his career in congress, his campaign for mayor and his marriage to Huma Adedin, a former aide to Mrs Clinton.
The case also became an issue in the closing days of 2016 presidential election when then-FBI director James Comey cited emails discovered on a laptop used by Weiner to justify reopening the probe into Mrs Clinton's private computer server.
Weiner, 53, dropped his head into his hand and wept as the sentence was announced by Judge Denise Cote in a New York federal courtroom.
After the hearing ended and Judge Cote left the bench, he sat in his seat for several minutes, continuing to cry.
He said nothing as he left the courthouse and must surrender to prison officials by November 6.
The sentencing completed the sordid downfall of the New York Democrat.
Admitting "I have a sickness, but I do not have an excuse", Weiner pleaded guilty in May to transferring obscene material to a minor, punishable by up to 10 years in prison, for illicit contact with a North Carolina teenager.
He sought to be spared from prison, tearfully telling Judge Cote that he had been "a very sick man for a very long time".
Weiner, weeping as he read from a written statement, said he had reached "rock bottom" with his crime.
Prosecutors said he sent the girl porn and got her to take her clothes off and touch herself on Skype.
Assistant US attorney Amanda Kramer had urged Judge Cote to give Weiner a significant prison sentence to end his "tragic cycle" of sexting.
The FBI was investigating Weiner's contact with the high school student when it came across emails on his laptop between Ms Abedin and Mrs Clinton, prompting then-FBI director James Comey to announce in late October 2016 that he was reopening the probe of Mrs Clinton's use of a private computer server.
Two days before election day, the FBI announced there was nothing new in the emails.
But Mrs Clinton has blamed Mr Comey's handling of the episode more than any other factor for her loss to Donald Trump.
In a recent NBC interview, she called the FBI director's intervention "the determining factor" in her defeat.
Weiner's lawyers had argued in court papers that he was undergoing treatment and was profoundly sorry for subjecting the girl to his "deep sickness".
They also portrayed her as an instigator, saying she wanted to generate material for a book and possibly influence the presidential election.
Prosecutors responded by arguing the victim's motives were irrelevant to the punishment and said Weiner's habit of getting caught sexting "suggests a dangerous level of denial and lack of self-control".
Weiner, wearing his wedding ring, seemed pensive just before Monday's hearing began. His parents were in the courtroom, but not his wife. He and Ms Abedin, who have a five-year-old child, are going through divorce proceedings.
Weiner was also fined 10,000 dollars (£7,400). After his sentence is served, he must undergo internet monitoring and must have no contact with his victim.
He must also enrol in a sex offender treatment programme.
Before announcing the sentence, Judge Cote said there was "no evidence of deviant interest in teenagers or minors" on Weiner's part.
She also said he is finally receiving effective treatment for what she said has been described as "sexual hyperactivity".
Weiner's behaviour in all its lurid detail - including his online alias "Carlos Danger" and a selfie of his bulging underwear - turned him and his last name into an irresistible punchline for late-night comics and embarrassed his wife again and again.
In her new memoir, What Happened, Mrs Clinton revealed that Weiner's wife "looked stricken" and burst into tears upon learning her husband had triggered what she termed Mr Comey's "October surprise".
"This man is going to be the death of me," Ms Abedin was quoted as saying.