A 32-year-old Wausau man accused of molesting his foster child will now head to prison, after he was convicted Thursday on child sex charges.

Matthew Cable\ first appeared in court in July 2016 on charges of first degree sexual assault of a child , sexual assault of a child by a foster parent, exposing genitals to a child and child abuse. As part of a plea agreement, Marathon County Reserve Judge Thomas Caine dismissed all but one charge — sexual contact with a child younger than 13 — and sentenced Cable to five years in prison followed by 10 years extended supervision.

Caine also ordered Cable be listed on the national sex offender registry for the rest of his life.

Police first learned of the alleged abuse when Cable’s wife told them she suspected her husband had molested a child in their care, court records show. The couple was in the process of adopting the alleged victim and other foster children when the abuse took place, police said.

Cable and his wife divorced in August, court records show.

Like all potential foster parents, Cable went through training and a background check before being allowed to foster children, according to court records.

Cable is entitled to 507 days credit for time served while awaiting trial, the judge ruled.