VATICAN CITY — Pope Francis has changed church teaching about the death penalty, saying in a new policy published Thursday that it is always "inadmissible" because it "attacks" the inherent dignity of all humans.

The Vatican said Francis had approved a change to the Catechism of the Catholic Church — the compilation of official Catholic Church teaching. Previously, the catechism said the church didn't exclude recourse to capital punishment "if this is the only possible way of effectively defending human lives against the unjust aggressor."

The new teaching, contained in Catechism No. 2267, says the previous policy is outdated and that there are other ways to protect the common good.

"Consequently the church teaches, in the light of the Gospel, that the death penalty is inadmissible because it is an attack on the inviolability and dignity of the person," and she works with determination for its abolition worldwide," reads the new text, which was approved in May but only published Thursday.

In an accompanying letter explaining the change, the head of the Vatican's doctrine office said the development of Catholic doctrine on capital punishment didn't contradict prior teaching, but rather was an evolution of it.

"If, in fact the political and social situation of the past made the death penalty an acceptable means for the protection of the common good, today the increasing understanding that the dignity of a person is not lost even after committing the most serious crimes," said Cardinal Luis Ladaria, prefect of the Congregation for the Doctrine of the Faith.

Francis has long railed against the death penalty, insisting it can never be justified, no matter how heinous the crime. He has also long made prison ministry a mainstay of his vocation. On nearly every foreign trip, Francis has visited with inmates to offer words of solidarity and hope, and he still stays in touch with a group of Argentine inmates he ministered to during his years as archbishop of Buenos Aires.

He announced his intention to change church teaching on capital punishment last October, when he marked the 25th anniversary of the publication of the catechism by announcing his intention to update it. The catechism, first promulgated by St. John Paul II, gives Catholics an easy, go-to guide for church teaching on everything from the sacraments to sex.

At that 2017 ceremony, Francis said the death penalty violates the Gospel and amounts to the voluntary killing of a human life, which "is always sacred in the eyes of the creator."

He acknowledged that in the past even the Papal States had allowed this "extreme and inhuman recourse." But he said the Holy See had erred in allowing a mentality that was "more legalistic than Christian" and now knew better.