NEW YORK (CBSNewYork/AP) — Anthony Weiner was sentenced to 21 months in prison Monday for sending obscene material to a 15-year-old girl.

Weiner, 53, cried when Judge Denise Cote announced the sentence. Sinking into his chair, he was seemingly inconsolable for five full minutes, CBS2’s Marcia Kramer reported.

READ MORE: Columbia Student Killed, Tourist Wounded In Stabbings Near Morningside Park; Suspect In Custody

WEB EXTRA: Read Weiner’s complete remarks (.pdf)

He was also sentenced to three years of supervised release and fined $10,000. Weiner must surrender to prison officials by Nov. 6.

After his sentence is served, he must undergo internet monitoring and must have no contact with his victim. He must also enroll in a sex-offender treatment program.

“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,” Acting Manhattan U.S. Attorney Joon H. Kim said in a statement. “Today, Anthony Weiner received a just sentence that was appropriate for his crime.”

Weiner left court after the sentencing without making a statement, 1010 WINS’ Juliet Papa reported.

Weiner’s friend, former State Sen. Tom Duane, waited outside the courtroom.

“I think that he’s as good a candidate for rehabilitation as anyone that I’ve seen,” he said. “There’s never any guarantees, but I know that Anthony is committed to working hard in his recovery and I believe that he will continue to do that while incarcerated.”

The former New York congressman had faced up to 27 months in prison after he pleaded guilty to one charge of transferring obscene material to a minor, punishable by up to 10 years in prison, for illicit contact with a North Carolina teenager.

Weiner sought to be spared from prison, tearfully telling Cote on Monday that he was “a very sick man for a very long time.” Weeping as he read from a written statement on a page he held in front of him, Weiner called his crime his “rock bottom.”

“The crime I committed was my rock bottom, but I am truly grateful that it finally began me on my recovery. Every day since has been a little bit better than the one before,” Weiner said. “I live a different and better life today. I’m no longer in thehole. Now I focus on how to live my new smaller life one day at a time, and I’m working to make amends for my actions. I was a very sick man for a very long time, but I’m also responsible for the damage I have done. Your honor, I have a disease, but I have no excuses.”

“You honor, I accept complete and total responsibility for my crime. I was the adult. I acted not only unlawfully but immorally. And if I had done the right thing, I would not be standing before you today. I am profoundly sorry to the victim for my crime,” he said.

But the judge said the notoriety of the case made prison a necessity, saying there is the opportunity “to make a statement that could protect other minors.”

“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 after the sentencing. “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.”

READ MORE: New York Weather: CBS2's 12/3 Friday Afternoon Forecast

Wearing his wedding ring, Weiner seemed pensive just before Monday’s hearing began. His parents were in the courtroom but not his wife, Huma Abedin. He and Abedin are currently going through divorce proceedings.

Before announcing the sentence, Cote said there was “no evidence of deviant interest in teenagers or minors” on Weiner’s part. She also said he is finally receiving effective treatment for what she said has been described as “sexual hyperactivity.”

Assistant U.S. Attorney Amanda Kramer on Monday had urged Cote to give Weiner a significant prison sentence to end his “tragic cycle” of sexting.

Prosecutors say he broke the law by having illicit contact with the 15-year-old girl using Skype and Snapchat.

In an exclusive interview with “Inside Edition,” the 15-year-old said she wanted to see if Weiner would take the bait when she direct messaged him on Twitter back in January of last year and he did, CBS2’s Reena Roy reported.

“I was disgusted,” she said. “That’s part of the reason I came forward.”

Weiner’s previous sexting scandals uprooted his political career and his life. After the most recent allegations, Abedin filed for divorce in May.

Nearly two weeks ago, Weiner and Abedin faced a judge. Their lawyers asked for parts of their divorce to be sealed since it involves their young son. The judge denied the request.

Lawyers for the 53-year-old Weiner have said in court papers that he’s undergoing treatment and is profoundly sorry for subjecting the North Carolina high school student to what his lawyers called his “deep sickness.” They also portrayed the girl as an instigator, saying she wanted to generate material for a book and possibly influence the presidential election.

Prosecutors responded that Weiner should be sentenced to up to two years prison for what he did, and his victim’s motives should not influence his punishment. They urged the judge to put Weiner’s claims of a therapeutic awakening in the context of a man who made similar claims after embarrassing, widely publicized interactions with adult women before encountering the teenager online in January 2016.

Prosecutors pointed out that Weiner had weathered sexting scandal after sexting scandal.

“Used graphic and obscene language to ask the minor victim to display her naked body and touch herself. He also sent an obscene message describing what he would do to here if she were 18,” they said.

The conduct “suggests a dangerous level of denial and lack of self-control,” they said.

As part of a plea bargain, Weiner had agreed to not appeal any sentence between 21 and 27 months, Roy reported.

The FBI was investigating Weiner’s contact with the high school student when it came across emails on his laptop between Abedin and Clinton, prompting 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 announced there was nothing new in the emails. But Clinton has blamed Comey’s handling of the episode more than any other factor for her loss to Donald Trump. In a recent NBC interview, she called the FBI director’s intervention “the determining factor” in her defeat.

MORE NEWS: Suffolk County Police Officer Timothy Thrane Set To Be Released From Hospital

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)