An Ohio priest posed as someone else while extorting nude photos from children, prosecutors claim.

The Rev. Robert McWilliams, 39, was arrested on four counts of possession of child pornography Thursday at St. Joseph Catholic Church in Strongsville after investigators searched his office and living space there earlier this month, Cleveland.com reports.

McWilliams, who appeared in court Tuesday, masked his identity by using a second cellphone to contact the teen victims, Assistant County Prosecutor Carl Sullivan said.

“He was pretending to be other people, extorting child porn,” the prosecutor said.

Agents from the Ohio Internet Crimes Against Children Task Force seized a cellphone, iPad and laptop that belonged to McWilliams during the Dec. 5 raid, the Catholic Diocese of Cleveland said in a statement.

McWilliams — a parochial vicar at the church’s school — was placed on administrative leave following his arrest, diocese officials said. He has been a priest since May 2017.

“It is with great sadness that we learned of the recent events surrounding the arrest of Father Robert McWilliams,” church officials said in a separate statement. “This has been devastating and heart-wrenching for the entire Catholic community in Northeast Ohio. All of us feel tremendous emotions of shock, disappointment and confusion.”

The alleged crimes took place during a three-year span between April 2016 and Dec. 5, according to court records cited by Cleveland.com.

Diocese officials said McWilliams communicated with his alleged victims on Snapchat, WJW-TV reports.