ROME — The prefect of the Congregation for the Doctrine of the Faith said his office sometimes has the “very unpleasant” obligation to take action against theologians in order to safeguard the faith.

Cardinal Luis Ladaria, the prefect, was asked specifically about the case of Irish Redemptorist Father Tony Flannery, 73, who was told by the congregation in July that he could not return to active ministry unless he signed a statement provided to him “regarding his positions on homosexuality, civil unions between persons of the same sex, and the admission of women to the priesthood.”

Flannery was removed from public ministry in February 2012 after the congregation questioned several columns for a magazine published by the Redemptorists in Ireland.

Responding to a question at a Vatican news conference Sept. 22, Ladaria said, “We did everything possible to dialogue with Father Flannery; it was not always easy. We did what we could; at a certain point we had to take some measures, which never involve making a judgment about a person — that always is reserved to our Lord to do — but regarding teaching or behavior.”

RELATED: Irish priest spurns Vatican plan that would have allowed return to ministry

“We always tried to maintain our respect for Father Flannery, but the obligation we have according to the disposition of the church is to safeguard the faith and, so to indicate when something does not conform to the faith,” the cardinal said. “This is a very unpleasant responsibility of (the Congregation for) the Doctrine of the Faith, very unpleasant, but it is our responsibility and we would be lacking if we did not fulfill this responsibility and say something when, often painfully,” the congregation must act.

Writing on his website about the congregation’s decision, Flannery said Sept. 16 that the issue of the ordination of women is now “freely discussed in the church,” saying he has been “on record for many years now in supporting, indeed emphasizing the necessity, of full equality for women, including ordination. How could I possibly sign that first proposition?”

In 1994, St. John Paul II said women could not be ordained because Jesus chose only men as his apostles. Pope Francis in 2016 affirmed the stance.

Flannery also described “official church language on homosexuality and homosexual relationships” as “appalling. I could not submit to it. As regards same-sex marriage, I voted in favor of it.”

Church teaching holds that a valid marriage can exist only between one man and one woman.