In a setback for Catholic hospitals, a California appellate court ruled that Dignity Health discriminated against a transgender man seeking a hysterectomy when one of its hospitals turned him away for the procedure.

The 1st District Court of Appeal ruled unanimously Tuesday that the state nondiscrimination law, the Unruh Act, barred discrimination against the patient, Evan Minton. The court sent the case back to the San Francisco Superior Court, which had dismissed the lawsuit on the basis that Minton had quickly received the procedure at another facility.

Minton now will be able to gather and present evidence of discrimination and damages. He is seeking an injunction prohibiting Dignity from refusing hysterectomies for transgender patients or any engaging in other discrimination based on gender identity.

Dignity, backed by the Catholic Health Association, had argued that the courts have recognized the right of religious-based hospitals not to provide services based on their religious principles.

But the court disagreed.

"Any burden [state law] places on the exercise of religion is justified by California's compelling interest in ensuring full and equal access to medical treatment for all its residents," the appellate panel said.

Catholic hospitals have faced lawsuits and controversy over application of their Ethical and Religious Directives which prohibit services such as abortion, contraception, tubal ligation, gender transition surgery and physician aid in dying.

Minton was scheduled to receive a hysterectomy at Dignity's Mercy San Juan Medical Center in August 2016. It was canceled two days after he told a nurse he is transgender. The procedure was rescheduled and performed soon after at one of Dignity's hospitals that operates under a less-restrictive religious policy.

The court wrote that "when his surgery was canceled, he was subjected to discrimination. Full and equal access requires avoiding discrimination, not merely remedying it after it has occurred."

"The Unruh Act promises full and equal access to public accommodations, yet Dignity Health refuses to provide necessary care to transgender patients," said Elizabeth Gill, a senior staff attorney with the ACLU of Northern California, in a written statement. "We will continue to fight for the right to care for everyone, even if their local hospital has a religious affiliation."

Dignity said it does not discriminate, but that it has the right not to provide services based on Catholic religious principles. It said Catholic hospitals do not perform sterilization procedures such as hysterectomies for any patient regardless of gender identity, unless there is a serious threat to the life or health of the patient.

"We are sensitive to the specific health needs of transgender patients and specialty care for trans individuals is offered at many of our care sites," Dignity said in a written statement. "In this case, Mr. Minton was able to quickly receive the sought-after procedure at another nearby Dignity Health hospital that is not Catholic-affiliated.

St. Joseph Health System in California is facing a similar lawsuit filed by a transgender man, Oliver Knight. He claims he was prepped to undergo a hysterectomy in August 2017 at St. Joseph Hospital in Eureka, Calif., as part of his treatment for gender dysphoria. But his OB-GYN surgeon came in minutes before the scheduled start of the procedure and told him the hospital wouldn't allow it because Knight is transgender.

In its response to Knight's lawsuit, St. Joseph said it has a constitutional right to refuse to perform procedures barred by Catholic religious doctrine.