Disgraced former Rep. Anthony Weiner was forced to register as a sex offender.

A New York City judge handed down the level-one designation — the lowest level — on Friday for his lewd text messages to an underage teen, according to reports. The former New York Democratic congressman will be registered as a sex offender for a minimum of 20 years.

Weiner did not attend the court hearing and has been living in a halfway house since he was released earlier than expected from prison.

He was sentenced to 21 months behind bars but was released from Federal Medical Center in Devens, Mass., three months early.

Weiner resigned from Congress in 2011 after he accidentally tweeted a photo of his groin, which he meant to send privately to a college student. More sexually explicit messages and photos with women other than his wife came out when he ran for mayor of New York City in 2013.

His ex-wife, Huma Abedin, a longtime aide to Hillary Clinton, announced during the 2016 presidential campaign that she and Weiner were separating after more suggestive photos surfaced. Weiner was then accused of sending inappropriate messages to a 15-year-old girl.

He reported to prison in November 2017.