New York (CNN) Former Rep. Anthony Weiner was sentenced Monday to 21 months in federal prison for sexting with a minor.

In addition to the prison term, Weiner also was sentenced to three years of supervised release.

Judge Denise Cote of the Southern District of New York stated that Weiner's sentence carried more importance because of his previous political career.

"Because of the defendant's notoriety, there is intense interest in the defendant's plea and sentence," Cote said in court. "It could make a difference in lives and is a very significant part of this sentence."

She added, "This is a serious crime that deserves serious punishment."

Weiner, the estranged husband of Huma Abedin, Hillary Clinton's former adviser, cried when the sentence was handed down.

"We are of course disappointed that Anthony was sentenced to prison, particularly so given that Judge Cote found that the treatment program Anthony had engaged in for the past year was showing great promise and should be continued," Weiner's attorney, Arlo Devlin-Brown said in a statement. "Judge Cote reasoned that because of Anthony's notoriety, a sentence of imprisonment could discourage others from following in his footsteps. We certainly hope this public service message is received, but it has resulted in a punishment more severe than it had to be given the unusual facts and circumstances of this case."

In May, Weiner, 53, pleaded guilty to one charge of transferring obscene material to a minor in federal court in Manhattan. The charges stem from communications that the former congressman had with a 15-year-old girl on social media sites between January and March 2016. Cote added that at the time Weiner was communicating with the girl, he was "in contact with 19 other women," a point the defense had used to argue Weiner did not have an abnormal interest in teenagers.

"This crime was my rock bottom," Weiner said in court. "I have no excuse ... I victimized a young person who deserved better."

The charge carries a maximum sentence of 10 years in prison . Prosecutors recommended a sentence of 21 to 27 months in jail, arguing Weiner's pattern of behavior "suggests a dangerous level of denial and lack of self-control warranting a meaningful incarceratory sentence." Defense attorneys asked that Weiner receive probation.

Weiner will report to a federal prison that has yet to be determined by the Bureau of Prisons on November 6. The defense requested that Weiner be held at a prison in Westchester to be closer to his son.

Weiner's probation terms require him to register as a sex offender. He must also participate in an outpatient sexual offender treatment that will be approved by the probation department.

The 15-year-old girl initially contacted Weiner through a direct message on Twitter in January 2016. Weiner and the girl continued to communicate on social media sites, including Facebook Messenger, Skype, Kik, Confide and Snapchat. The last three messaging applications delete images and messages after users view them.

Weiner asked the teen to "engage in sexually explicit conduct via Skype and Snapchat, where her body was on display, and where she was asked to sexually perform for him," prosecutors said in a sentencing memorandum. Weiner was fully aware of the girl's age when they were communicating, prosecutors said.

In the sentencing hearing, Cote said it was irrelevant that the girl contacted Weiner first.

"The laws fully protect her," Cote said.

Weiner's attorneys said his crimes were a "product of sickness" and maintained he wasn't a sexual predator.

"He responded as a weak man, at the bottom of a self-destructive spiral, and with an addict's self-serving delusion that the communications were all just Internet fantasy," the defense wrote.

The judge acknowledged his illness during the sentencing but said that it "did not involve sexual contact."

"This is a very strong compulsion as we have seen. It will remain a challenge for years to come," Cote said in court.

In his initial guilty plea back in May, Weiner said that his illness was the reason he had committed these crimes, even though he knew they were wrong.

"I knew this was as morally wrong, as it was unlawful," Weiner said in his guilty plea in court. "This fall, I came to grips for the first time with the depths of my sickness. I had hit bottom."

A downward spiral

Weiner's personal and professional life had been collapsing around him for half a decade even before the sexting case.

He resigned from Congress after a lewd picture appeared on his Twitter page in June 2011. At first, he claimed his account had been hacked but later revealed that he had lied. Sexually charged, sometimes explicit, texts with women also emerged around this time.

Weiner insisted his marriage with Abedin was intact. She gave birth to a son, the couple's only child, six months later.

In 2013, Weiner sought to revive his political career by running for mayor of New York. Two months after he announced his candidacy, screenshots surfaced of sexual conversations that Weiner had with a woman the previous year.

At the time, Abedin joined Weiner in a news conference, saying that although her husband had made some "horrible mistakes ... what I want to say is I love him, I have forgiven him, I believe in him ... we are moving forward."

During the 2016 campaign, it was revealed that emails from Hillary Clinton containing classified information were forwarded by Abedin to a computer used by Weiner. A decision by former FBI Director James Comey to alert Congress just days before the election about his agency's investigation into messages potentially related to Clinton's personal server has been cited by Clinton as a key reason she lost the presidential race. Investigators ultimately determined the emails were mostly ones they had previously seen and Clinton was ultimately cleared by the FBI two days before the election.

In May, Abedin filed for divorce around the time Weiner pleaded guilty in the sexting case.