A California transgender man can go ahead with a discrimination lawsuit against a Catholic hospital that canceled his hysterectomy, an appeals court ruled Tuesday.

The decision by the 1st District Court of Appeal in San Francisco overturns a lower court ruling dismissing the discrimination lawsuit, The Sacramento Bee reported Wednesday.

Evan Minton sued Mercy San Juan Medical Center in 2017 for canceling his scheduled hysterectomy after he mentioned to a nurse two days before surgery that he's transgender.

Hospital operator Dignity Health quickly helped transfer the surgery to a non-Catholic facility. Presiding Judge Stuart Pollak wrote that didn't negate Minton's complaint because Dignity offered the alternative only after pressure from his advocates.

California civil rights law says businesses must offer full and equal access to residents.

Dignity Health, which is among the largest health systems in the country, said in a statement Wednesday that it welcomes everyone but that its Catholic hospitals "do not perform sterilizing procedures" unless there is a serious threat to the patient's life or health.

In an earlier statement to the newspaper, the largest hospital provider in California said its Catholic facilities "do not provide elective sterilizations."

Dr. Lindsey Dawson, Minton's surgeon, has said she routinely performs hysterectomies at Mercy San Juan.

Minton was diagnosed with gender dysphoria, a medical condition where a person experiences deep discomfort with the gender assigned them at birth, according to the American Psychiatric Association.