Former Rep. Anthony Weiner was sentenced Monday to 21 months in prison for sexting with a 15-year-old girl in a case that rocked Hillary Clinton’s campaign for the White House in the closing days of the race and may have cost her the presidency.

Weiner, 53, dropped his head into his hand and wept as the sentence was announced by U.S. District Judge Denise Cote. As the judge and spectators filed out of the courtroom, he sat crying quietly with his head down and his attorneys silent beside him. He must surrender to prison officials by Nov. 6.