CHICAGO (AP) — A convicted sex offender who continued to attack women while he was in prison has been ordered to remain in an Illinois treatment and detention facility.

Attorney General Lisa Madigan said Tuesday a Cook County jury determined 52-year-old Derrick Patterson is a sexually violent person. A judge ordered him returned to a state facility in Rushville.

Under Illinois law someone who both has a record of violent sexual assault and who suffers from mental illness to be held for treatment by Illinois’ Department of Human Services after serving their prison sentence.

The attorney general’s office must prove the offender is likely to commit more sexually violent acts if released.

Madigan says Patterson was charged with sexual assault multiple times since 1987, including attacking and attempting to rape a prison nurse.