Former Congressman Anthony Weiner was sentenced Monday morning to 21 months behind bars for sexting with an underage girl.

The disgraced politician pleaded guilty back in May to sending inappropriate messages to a 15-year-old girl in North Carolina. He had pleaded guilty to one count of transferring obscene material to a minor.

"The crime I committed was my rock bottom," Weiner read in a tearful statement during his sentencing. "Today I am gratefully recovering."

The charges stem from a Daily Mail story that exposed how Weiner exchanged lewd text messages with the girl. He video chatted with her, too, asking her to undress and perform sexual acts.

Prosecutors wanted him to spend up to 27 months behind bars.

During the sentencing, U.S. District Judge Denise L. Cote told a tearful Weiner, "This is a serious crime that deserves serious punishment."

The judge also ordered Weiner to pay a $10,000 fine.

Weiner's defense team said the 53-year-old has a "deep sickness," and that he should get probation and continue seeking treatment.

His lawyers blamed the girl for wanting to influence the 2016 presidential election.

Weiner's wife Huma Abedin was a close aide to Hillary Clinton during her campaign.

The investigation into Weiner eventually led the FBI to reopen its investigation into Clinton's private email server.

Weiner had to register as a sex offender earlier this year.

Abedin and Weiner are now getting divorced.

In a statement, acting Manhattan U.S. Attorney Joon H. Kim said in part, "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 delivered an emotional statement before he was sentenced.

He noted his prior sexting scandals, and admitted he never changed his behavior or sought treatment until the most recent allegations against him. He said he is a sex addict, and is now recovering.

Weiner is scheduled to report to prison Nov. 6. Once he is released, he will have to undergo a sex offender treatment program.

Before this, Weiner had two other public sex scandals. The first forced him to resign from Congress in 2011, and the second derailed his campaign for mayor in 2013.