WILMINGTON, N.C. (AP) — A North Carolina man has pleaded guilty to 50 child sexual assault charges and could serve up to 40 years in prison.

News outlets report 41-year-old Jason Lee Ramsey of Rocky Point entered guilty pleas on Monday in New Hanover County Superior Court.

Prosecutors said Ramsey befriended the victim through his church when the child was 13, and a year later, began raping the victim and engaging in sexually explicit correspondence over the next three years.

According to prosecutors, the assaults took place in both New Hanover and Pender counties. The district attorney’s office said in a news release that when the victim turned 18, she told her parents about the abuse.

Ramsey will be required to register as a sex offender for the rest of his life.