Former Democratic Congressman Anthony Weiner must surrender to prison officials by Nov. 6 to begin his 21-month sentence for sexting an underage girl. Macey J. Foronda/BuzzFeed Anthony Weiner, a former Democratic congressman from New York and husband of a top Hillary Clinton aide, has been sentenced to 21 months in prison for sexting with a 15-year-old girl.

This comes after years of revelations about Weiner's explicit communications with women he met on the internet.

The FBI's investigation into Weiner's sexting took the national spotlight when it prompted the FBI to re-open its investigation into Clinton's use of a private email server after investigators found potential relevant communications on Weiner's computer.

A rising star in the Democratic Party

Weiner, a Brooklyn native and former aide to then-congressman Chuck Schumer, served on the New York City Council for six years before being elected to Congress in 1998 to represent his home district in Brooklyn. Known for his straight-talking, sometimes brash demeanor, Weiner was made famous when he aggressively denounced his Republican colleagues after they sank a bill that would have provided $7.4 billion in healthcare aide for 9/11 emergency responders.

In August 2001, Weiner met Huma Abedin, an aide to then-New York Sen. Hillary Clinton, and asked her out for a drink. Clinton encouraged the relationship and nine years later, after Abedin and Weiner reconnected in 2007, the two were married. Former President Bill Clinton officiated the ceremony.

The scandal begins

Weiner, 53, first made salacious headlines in May 2011 when he tweeted a photo of his bulging crotch in boxer briefs. The congressman first claimed his account was hacked, but the following month admitted he took the photo and inadvertently posted the tweet. On June 11, he announced he would be taking a leave of absence from Congress and five days later he resigned, apologizing for his actions in a Brooklyn press conference.

Six months later, Abedin gave birth to the couple's son, Jordan Zain Weiner.

Two years later, in May 2013, Weiner announced his second bid for New York City mayor.

But in July 2013, screenshots of an explicit conversation between Weiner and a 22-year-old woman surfaced on a gossip website.

In a press conference following the revelation, Weiner, with Abedin by his side, confirmed that he had sent the messages and photos, but said that the transgressions were behind him and that he would continue campaigning.

Abedin, speaking after her husband, said that the couple was "moving forward" and that she would continue to support Weiner despite the "horrible mistakes" he had made.

"We discussed all of this before Anthony decided he would run for mayor, so really what I want to say is, I love him, I have forgiven him, I believe in him," Abedin said, adding, "It took a lot of work, and a whole lot of therapy, to get to a place where I could forgive Anthony."

But the revelations damaged Weiner's campaign and he ultimately came in fifth in the Democratic primary in September 2013.

Anthony Weiner appears at a July 2013 press conference with his wife, Huma Abedin. Eric Thayer/Reuters

From scandalous to criminal

In August 2016, the New York Post posted still more photos and screenshots of communications between Weiner and another woman in 2015. One of the photos taken by Weiner showed him in boxer briefs while his then-four-year-old son lay next to him in bed.

The following day, Abedin announced she was separating from her husband.

"After a long and painful consideration and work on my marriage, I have made the decision to separate from my husband," she said in a statement.

The next month, the FBI and the NYPD announced they were opening an investigation into newly published communications between Weiner and a 15-year-old girl in England, who alleged in an interview with The Daily Mail that she and Weiner had exchanged messages for several months beginning in January 2016.

Clinton e-mail investigation

On October 27, 2016, FBI Director James Comey announced in a letter to Congress that he was reopening the investigation into Hillary Clinton's use of a private email server while she was secretary of state after finding potentially relevant material on devices that had been seized from Weiner.

Clinton wrote in her campaign memoir, "What Happened," that Abedin "looked stricken" after hearing the news and burst into tears.

"Anthony had already caused so much heartache. And now this," Clinton wrote.

"This man is going to be the death of me," Abedin, who first worked for Clinton as a 19-year-old intern in the 1990s, said as her boss hugged her.

Huma Abedin, aide to Democratic U.S. presidential candidate Hillary Clinton, at the conclusion of the second official 2016 Democratic presidential debate in Des Moines, Iowa, November 14, 2015. REUTERS/Jim Young

Prison time

In May 2017, Weiner pleaded guilty to one count of transferring obscene material to a minor and told the court, "I have a sickness, but I do not have an excuse."

Shortly thereafter, Abedin announced she was divorcing her husband.

Weiner was sentenced to nearly two years in federal prison on Monday for sexting the teenage girl. His lawyers asked for probation, but the government recommended a sentence of between 21 and 27 months.

In a lengthy letter to the judge, Weiner said that he "can't ever imagine not feeling regret" for his abuses and said that his "continued acting out over years crushed the aspirations of my wife and ruined our marriage."

"My regret keeps me awake at night and fills me with fear from the moment I awaken," he said.

Weiner is undergoing psychological treatment for what he says is an "addiction" and is working at a non-profit organization he founded in 2014 to train young and formerly incarcerated people for jobs in the culinary industry.

"I am still very good at identifying challenges for my neighbors and going to work to solve them," he wrote in his letter. "This was what drove me for decades in public life and I still am animated by that mission today."