Feb. 17 (UPI) — Anthony Weiner has been released from prison and sent to a re-entry program in New York, according to Federal Bureau of Prisons records.

Weiner, 54, was transferred to a residential re-entry center in Brooklyn to serve the remainder of his 21-month prison sentence for sending sexually explicit text messages to a 15-year-old girl, the records show.

The FBP’s website states the residential re-entry centers, also known as halfway houses, are intended to allow inmates to “gradually rebuild their ties to the community and facilitate supervising ex-offenders’ activities during this readjustment phase.”

Weiner, a former Democratic House representative from New York, had been detained at Federal Medical Center Devens in Ayer, Mass., and it was announced in October that he is set to be released from prison in May, about three months early, because of good behavior.

In September 2017, Weiner was sentenced to 21 months in prison after pleading guilty to one count of transferring obscene material to a minor.

As part of his plea agreement, Weiner was also ordered to register as a sex offender, pay a $10,000 fine and be under three years of supervised release.

Prior to being sentenced to prison, Weiner was forced to resign in 2011 after it was revealed he’d exchanged lewd photos with women other than his wife and it happened again in 2013 when Weiner was running for mayor.