ROME — Archbishop John Nienstedt and one of his top deputies have resigned their offices amid criminal charges against the Archdiocese of Minneapolis and Saint Paul, the Vatican announced Monday.

Nienstedt and Auxiliary Bishop Lee Anthony Piche resigned under the code of Church law that allows bishops to resign before they retire, either because of illness or some other “grave reason” that makes them unfit for office.

Earlier this month, prosecutors charged the archdiocese as a corporation for having ignored repeated reports of inappropriate behavior by a priest who was later convicted of molesting two boys.

The charges were filed against the archdiocese and no individual was named in the indictment.

Soon after the decision was announced in Rome, Nienstedt released a statement saying that his continued leadership was not possible.

“My leadership has unfortunately drawn attention away from the good works of His Church and those who perform them. Thus, my decision to step down,” he said.

Still, Nienstedt stood by his decisions as archbishop.

“I leave with a clear conscience knowing that my team and I have put in place solid protocols to ensure the protection of minors and vulnerable adults,” he said.

Piche also released a statement: “The people of the Archdiocese of Saint Paul and Minneapolis need healing and hope. I was getting in the way of that, and so I had to resign.”

Bishop Bernard Anthony Hebda, co-adjutor bishop of Newark, will serve as apostolic administrator of Minneapolis-Saint Paul.

A second auxiliary bishop, Andrew Cozzens, remains in his position.

The criminal charges against the archdiocese stem from its handling of Curtis Wehmeyer, a former priest at Church of the Blessed Sacrament in St. Paul, who is serving a five-year prison sentence for molesting two boys and faces prosecution involving a third boy in Wisconsin.

Prosecutors say Church leaders failed to respond to “numerous and repeated reports of troubling conduct” by Wehmeyer from the time he entered seminary until he was removed from the priesthood in 2015. The criminal complaint says many people — including parishioners, fellow priests, and parish staff — reported issues with Wehmeyer, and many of those claims were discounted.

A diocesan canon lawyer-turned-whistleblower alleged widespread cover-up of clergy sex misconduct in the archdiocese, saying archbishops and their top staff lied to the public and ignored the US bishops’ pledge to have no tolerance of priests who abuse.

Canon lawyer Jennifer Haselberger charged that the Church used a chaotic system of record-keeping that helped conceal the backgrounds of guilty priests who remained on assignment.

She said she repeatedly warned Nienstedt and his aides about the risk of keeping priests accused of abuse in ministry, but they took action only in one case. As a result of raising alarms, she said she was eventually shut out of meetings about priest misconduct, and later resigned.

The resignations of Nienstedt and Piche come about two months after Francis accepted the resignation of the former bishop of the Diocese of Kansas City, Robert Finn, who was convicted three years ago for failing to report suspected child abuse.

Last week, the Vatican announced the creation of a special tribunal aimed at holding bishops accountable for responding appropriately to accusations of sexual abuse of minors lodged against personnel under their authority.

The Rev. Federico Lombardi, the Vatican spokesman, said it’s too soon to speculate if Nienstedt or Piche would be tried in this system. “The situation is too complex to make a prediction on this yet,” he said.

Lombardi said that even though the tribunal will “clearly deal with these cases that don’t have to do with committing a crime, but with accountability,” the organization is not yet ready to start ruling on cases.

Meanwhile, a critic of Nienstedt says the archbishop’s resignation was necessary because the sex abuse scandal there has become overwhelming.

The Rev. Michael Tegeder of St. Francis Cabrini Church in Minneapolis has been calling for Nienstedt’s resignation for two years, saying Nienstedt has undermined the archdiocese and the safety of its children.

Tegeder said it’s time to pick up the pieces and find a new direction, and called Nienstedt’s resignation is a sign of hope that change is possible.

Material from the Associated Press was used in this story.