NEW YORK – Anthony Weiner, the former New York congressman who went to prison in November 2017 after pleading guilty to sexting with a 15-year-old girl, is to be freed about three months early.

Weiner’s release date has been brought forward from August 2019 to May 2019, according to the Federal Bureau of Prisons.

"This projected release date includes credit for good conduct time earned and good conduct time that may be earned throughout the remainder of his sentence," the Bureau of Prisons told CNN.

Federal prisoners are not eligible for parole. But they can get as much as 54 days credit annually for good behavior.

The jail time came after Weiner, 54, pleaded guilty in federal court in May 2017 to a charge of transferring obscene material to a minor. In September of that year he was sentenced to 21 months in prison.

"This crime was my rock bottom," Weiner said in court. "I have no excuse. ... I victimized a young person who deserved better." He also said he was “a very sick man for a very long time.”

Weiner was first elected to Congress in 1998 and easily won re-election in his Brooklyn district six more times. His star rose in the Democratic Party in 2010 after a short but dramatic speech before Congress in which he blasted Republicans for voting against a federal aid bill for first-responders to the 9/11 terror attacks.

A year later he was out, resigning his seat after admitting to exchanging "messages and photos of an explicit nature with about six women" over a period of about three years.

Weiner attempted a comeback and was running for mayor of New York City in 2013 when it emerged that he was sending explicit photos to a 22-year-old woman under the pseudonym "Carlos Danger."

Weiner married Huma Abedin, a longtime aide to Hillary Clinton, in 2010. The couple had a son in 2011. Abedin separated from Weiner in 2016 and filed for divorce after his guilty plea.

The relationship became a crucial factor in the 2016 presidential campaign when then-FBI director James Comey reopened an investigation into Clinton emails less than two weeks before Election Day. The FBI cited a batch of emails discovered in the Weiner probe. Days later, the FBI said nothing new nor damaging against Clinton had been discovered.

More:Sex scandals in N.Y.: Spitzer, Weiner and now Attorney General Eric Schneiderman

More:I was 'a very sick man': Tearful Anthony Weiner gets 21 months in sexting case

More:Huma Abedin files for divorce from Anthony Weiner

More:New Trump ad uses Weiner, Abedin to hit Clinton on FBI investigation

In the sexting case, prosecutors said the teen initiated the communications with Weiner via Twitter on Jan. 23, 2016. The girl acknowledged she was a minor, but the contacts continued over Facebook messenger, Skype, Snapchat and other social media outlets.

Even after the girl told Weiner she was 15, Weiner asked her to show him her naked body, which she did, prosecutors said. He also sent her pornography.

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

Contributing: John Bacon from McLean, Virginia