Anthony Weiner, the former New York congressman, has been ordered to register as a sex offender following his early release from prison.

Weiner resigned from Congress, where he represented a New York district for 12 years as a Democrat, in 2011 after tweeting a semi-nude photograph of himself that he’d meant to send to a college student.

He later ran into similar controversy during his unsuccessful campaign for mayor of New York City in 2013. In 2016, he was accused and later convicted of sending sexual messages to a minor.

At a court hearing on Friday, Weiner was designated a Level 1 offender by a New York City judge, Associated Press reports.

He will have to remain registered as a sex offender for at least 20 years. The former congressman, who has been living in a halfway house since his release two months ago, did not attend the hearing.

Weiner still has three years of court supervision following his release, and as a sex offender, he will have to verify his address every year and give the state notice within 10 days if he moves, and must go to a police station every three years for a new picture to be taken.