A priest in the St. Cloud Diocese has been charged with having sex with a woman he was counseling.

Anthony J. Oelrich, 51, was jailed and charged Tuesday in Stearns County District Court with third-degree criminal sexual conduct and put on administrative leave by the diocese.

It is illegal for clergy to have sexual relations under those circumstances, police said.

The woman was seeing Oelrich for spiritual guidance regarding a past relationship that involved sexual abuse, the criminal complaint read.

She first revealed the abuse to Oelrich during confession in 2013. She told investigators that she was suicidal and Oelrich consoled her, telling her to contact him whenever she felt the need.

Twice, Oelrich unzipped his pants and had her touch him, the complaint read. When she suffered from insomnia, she told investigators that Oelrich came to her home and slept with her until early morning.

In January 2014, after she was invited to the rectory to for dinner and cards with Oelrich, he suggested they have intercourse, the complaint states. They reportedly had sex on multiple times until April 2014. In that same period, she said she also saw him for confession.

Investigators met with Oelrich while looking into the woman’s allegations of abuse in her previous relationship. Oelrich said he was aware of the abuse but couldn’t disclose details, citing the privilege of confession. In covertly recorded conversations, investigators said Oelrich acknowledged he had a “boundary violation” with the woman.

Oelrich has been with the diocese for more than 20 years. He was serving as director of Continuing Education for Clergy in the St. Cloud Diocese and pastor of Christ Church Newman Center Catholic Student Community in St. Cloud.

Diocese Bishop Donald Kettler said he placed Oelrich on administrative leave after the arrest. He also suspended Oelrich’s priestly duties.

Oelrich left jail Wednesday on his own recognizance.