ST. CHARLES, Ill. (AP) — A Rockford man has been sentenced to life in prison for sexually assaulting a child.

Kane County Judge James Hallock sentenced 40-year-old James E. Melvin this week. Hallock in December found Melvin guilty of predatory criminal sexual assault and six counts of aggravated predatory criminal sexual abuse for the 2009 assault.

Prosecutors said the former Carpentersville man knew the girl, who was under 13. They say the girl told her mother, who contacted police.

It was the second time Melvin was convicted in the case. He pleaded guilty in 2009 but an appeals court in 2015 ruled his plea was improper and returned the case to the lower court.

Prosecutors say Melvin also was convicted of predatory criminal sexual assault in Cook County in 1998.