New York - Anthony Weiner's sexting compulsion cost him his seat in Congress, his shot at becoming New York mayor and his marriage, and may have even denied Hillary Clinton the presidency. On Monday, it cost him his freedom.Weiner, 53, dropped his head into his hands and wept as a federal judge sentenced him to 21 months behind bars for illicit online contact with a 15-year-old girl, his tears flowing long after the gavel came down on a case he called his "rock bottom".As his parents looked on in the courtroom, the New York Democrat was given until November 6 to report to prison for misconduct that included getting the North Carolina high school student to strip and touch herself on Skype and Snapchat.In handing down the sentence, US District Judge Denise Cote cited a need in such a highly publicised case to "make a statement that can protect other minors".The judge said Weiner's habit of exchanging sexually explicit messages and pictures with young women shows a "very strong compulsion" - so strong that "despite two very public disclosures and the destruction of his career on two occasions, he continued with the activity".Calling himself "a very sick man for a very long time," Weiner tearfully apologised to the teen and sought to assure the judge he had finally learned his lesson. He has been undergoing therapy."I stand before you because I victimised a young person who deserved better," he said, adding, "Your Honour, I'm not asking that you trust that my recovery is real. I ask you for the opportunity to prove that it is real."ClintonWearing a wedding band, he also spoke of his devotion to the 5-year-old son he has with his wife, Huma Abedin, formerly Clinton's closest aide. The couple is going through a divorce.Weiner's habit led him to resign his House seat in 2011, doomed his 2013 run for mayor, and rocked Clinton's 2016 presidential campaign during the closing days of the race, when FBI agents investigating his contact with the teen came across emails on his laptop between Abedin and Clinton.That discovery prompted then-FBI Director James Comey to announce in late October 2016 that he was reopening the probe of Clinton's use of a private computer server.Two days before Election Day, the FBI declared there was nothing new in the emails. But in a recent interview, Clinton called Comey's intervention "the determining factor" in her defeat.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 mortified his wife again and again.