REUTERS/Brendan McDermid
Weiner had pleaded guilty to one count of transferring obscene material to a minor for exchanging lewd texts with a 15-year-old girl. He started to cry after the sentence was read by Judge Denise Cote in New York City.
In a statement he read in court on Monday, Weiner said he was "a very sick man for a very long time" and called his crime "rock bottom."
He must surrender to prison officials by November 6, according to The Associated Press.
Weiner resigned from Congress in 2011 after posting a sexually explicit photo to Twitter. In the wake of the scandal, he admitted messaging several women and sharing explicit photos.
His later bid in 2013 to become New York City mayor was derailed after another woman came forward to reveal more explicit messages that Weiner sent.
Weiner is married to longtime Hillary Clinton aide Huma Abedin, who filed for divorce earlier this year. The two have a 5-year-old son, Jordan. Abedin was notably absent in court on Monday.
The latest scandal over messaging the 15-year-old girl led to authorities seizing Weiner's computer. Then-FBI director James Comey announced he was reopening an investigation into Clinton's emails based on the emails found on Weiner's computer. Clinton has said she believes that move cost her the presidency.