Former Rep. Anthony Weiner exits federal court after pleading guilty to one count of sending obscene messages to a minor in New York City on May 19, 2017. Reuters

Anthony Weiner, the disgraced former congressman who pleaded guilty to sending sexually explicit material to a teen, has been released from federal prison ahead of the end of his 21-month sentence.

Federal records show Weiner, who was imprisoned in Massachusetts, is now being housed at a Residential Re-entry Management facility in Brooklyn, New York, ahead of his final release date of May 14. The records do not state when Weiner was transferred from the Massachusetts prison.

Weiner, 54, was sentenced to jail time after he pleaded guilty in 2017 to sending obscene material to a 15-year old girl.

Get Breaking News Delivered to Your Inbox

Weiner, who resigned from Congress in 2011 over another scandal involving lewd messages, began his sentence at the Federal Medical Center Devens in Massachusetts in November 2017. He was initially slated to be released on Aug. 5, 2019, but his release was moved up to May due to good behavior, according to the Bureau of Prisons.

Weiner was also sentenced to serve three years probation upon his release, and was required to register as a sex offender.

Before his sentencing, Weiner, who was previously married to former Hillary Clinton aide Huma Abedin, called himself a "sick man" and an "addict." He said he accepted full responsibility for victimizing "a young person who deserved better" and called the crime he committed his personal "rock bottom."

After the 15-year-old came forward with emails between herself and Weiner, prosecutors began an investigation into his laptop, which led to the discovery of a batch of emails from Clinton to Abedin. Former FBI Director James Comey reopened the investigation in Clinton's emails in the final weeks before the 2016 election.