Anthony Weiner breaks down after he's sentenced to 21 months for sexting Weiner pleaded guilty in May.

 -- Anthony Weiner, the disgraced former New York congressman and soon-to-be ex-husband of top Hillary Clinton aide Huma Abedin, broke down in federal court today as he was sentenced to 21 months in prison for sending obscene material to a 15-year-old high school student in North Carolina.

Weiner, 53, who pleaded guilty last May to a single count of transferring obscene material to a minor, was also sentenced to three years of supervised release.

When Judge Denise Cote announced her decision, Weiner, who was seeking probation, dropped his head and started to cry.

"This is a serious crime that deserves serious punishment," Cote said in court.

Federal prosecutors had asked a judge to send Weiner to prison for 21 to 27 months. Acting Manhattan U.S. Attorney Joon H. Kim said in a statement today, "Anthony Weiner, a former Congressman and candidate for Mayor, asked a girl who he knew to be 15 years old to display her naked body and engage in sexually explicit behavior for him online. Justice demands that this type of conduct be prosecuted and punished with time in prison. Today, Anthony Weiner received a just sentence that was appropriate for his crime."

Weiner sobbed audibly in court for a few minutes after the proceeding ended. He did not speak as he left the courthouse.

Today's sentencing marks the end of a six-year saga during which Weiner resigned from Congress, unsuccessfully ran for mayor of New York and separated from Abedin, who filed for divorce the day he was indicted. Weiner and Abedin are parents to a young son.

Weiner's crime may have played a role in Clinton's loss to Donald Trump. When the FBI found Abedin's email on his computer, then-FBI Director James Comey revisited the investigation into Clinton's use of a private server.

Defense attorney Arlo Devlin-Brown said today that Weiner's "repeated acts of self destruction are not those of a scheming criminal."

Weiner had asked for probation, citing his continual recovery from an illness that cost him his marriage and career.

“A term of imprisonment would bring Anthony’s indisputably successful treatment for the sickness underlying his crime to an immediate and complete halt and separate Anthony from the son who has motivated his recovery,” his defense attorneys wrote.

In an emotional statement in May, Weiner said he "compulsively sought attention from women," engaging many of them in sexual and non-sexual conversations. He said his behavior started when he entered Congress and it continued through the first six months of 2016.

"These destructive impulses brought great devastation to my family and friends, and destroyed my life's dream of public service," he said.

Weiner said he "came to grips for the first time with the depths of my sickness" last fall and entered "intensive treatment."

"I have a sickness," Weiner said, "but I do not have an excuse."