NEW YORK (AP) —  Anthony Weiner has been sentenced to 21 months in prison for sexting with a 15-year-old girl in a case that may have cost Hillary Clinton's the presidency.

The former Democratic congressman from New York had faced up to 27 months in prison on Monday after his guilty plea to one charge of transferring obscene material to a minor. Prosecutors say he broke the law by having illicit contact with a 15-year-old girl using Skype and Snapchat.

Weiner's sexting habit destroyed his career in Congress, his campaign for mayor and his marriage to Huma Adedin, a former aide to Clinton.

It also became an issue in the closing days of 2016 presidential election when then FBI Director James Comey cited emails discovered on a laptop used by Weiner to justify reopening the probe of Clinton's private computer server.

(STORY BY ASSOCIATED PRESS)

More From WIBX 950