Pope Francis has established legal procedures to remove bishops who botch handling sex abuse cases, saying they can be kicked out of office if the Vatican finds they were negligent in doing their jobs.

In a law published on Saturday, Francis answered a long-running demand by victims of abuse and their advocates to hold bishops accountable for failing to protect their flocks from pedophiles. Victims have long accused bishops of covering up for abuse, moving rapists from parish to parish rather than reporting them to police.

In the law, Francis acknowledged that the church’s canonical code already allows for a bishop to be removed for “grave reasons.”

But he said he wanted to precisely state that negligence, especially negligence in handling abuse cases, can cost a bishop his job.

Bishops “must undertake a particular diligence in protecting those who are the weakest among their flock,” Francis wrote in the law, called a motu proprio.

The statute alters the original proposal approved by Francis last year to establish a tribunal inside the Congregation for the Doctrine of the Faith to hear negligence cases.

Francis’ sex abuse advisory board had recommended that the Congregation prosecute negligent bishops because it is already responsible for overseeing actual sex abuse cases against clergy.

But amid a host of legal and bureaucratic questions posed by that original proposal, Francis decided to streamline the procedure and task the Vatican offices that are already in charge of handling bishop issues to investigate and punish negligence cases.

In the law, Francis said a bishop can be removed if his actions or omissions cause “grave harm,” either physical, moral, spiritual or financial, to individuals or communities.

The bishop himself doesn’t need to be morally guilty: It’s enough if he is purely lacking in the diligence required of his office. When the cases concern abuse, it’s enough that the negligence is “serious,” the law says.

The procedures call for the Vatican to start an investigation when “serious evidence” is provided that a bishop was negligent. The bishop will be informed and allowed to defend himself.

At the end of the investigation, the Vatican can prepare a decree removing the bishop or ask him to resign within 15 days.

If he doesn’t, the Vatican can go ahead with issuing a resignation decree.

Any decision to remove the bishop must first be approved by the pope, who will be assisted by a group of legal advisers, the law says.