NEW YORK (AP) — Former Rep. Anthony Weiner (D-NY) has been ordered to register as a sex offender as he nears the end of a 21-month prison sentence for having illicit online contact with a 15-year-old girl.

A New York City judge on Friday designated Weiner a Level 1 sex offender, meaning he’s thought to have a low risk of reoffending.

Weiner must register for a minimum of 20 years. He’s required to verify his address every year and visit a police station every three years to have a new picture taken.

Weiner didn’t attend Friday’s court hearing. He’s in a halfway house after serving most of his sentence at a prison in Massachusetts.