A federal judge in Texas has blocked national regulations aimed at protecting transgender people from discrimination in health care, a move that opponents of the measures are celebrating as protecting doctors' religious beliefs.

In a 46-page ruling issued Saturday, Judge Reed O'Connor said the regulations "likely" violate "the Religious Freedom Restoration Act" and were flawed because laws prohibiting discrimination based on sex were incorrectly stretched by the federal government to include discrimination based on gender identity.

It's the second ruling by O'Connor that thwarts President Barack Obama's efforts to increase protections for transgender individuals at a time when they are being hotly debated across the country. He issued a similar injunction in October blocking a federal move that required public schools to let transgender students use restrooms consistent with their gender identity.

That injunction followed a May letter from U.S. Department of Justice and the U.S. Department of Education stating that the federal agencies "treat a student's gender identity as the student's sex for purposes of Title IX and its implementing regulations." Title IX prohibits sex discrimination in educational programs and activities.

Ezra Young, director of Impact Litigation at Transgender Legal Defense and Education Fund, challenged both rulings as misinterpretations of federal law. He called Saturday's "flatly contrary to law," "morally repugnant," and predicted it would be overturned on appeal.

"The U.S. Supreme Court has long recognized that sex discrimination takes many forms, and our nation's expansive and unyielding nondiscrimination laws necessarily reach sex discrimination whenever and wherever it strikes," Young said in a statement Saturday.

Lawyers representing the federal government could not be reached for comment Saturday.

O'Connor's ruling comes after Texas, seven other states and three private health care providers sued the federal government in August over the regulations issued in May and built on Obama's Affordable Care Act.

A portion of the regulations were set to go into effect Sunday.

The Saturday ruling stated that "plaintiffs will be forced to either violate their religious beliefs or maintain their current policies which seem to be in direct conflict with the (federal regulations) and risk the severe consequences of enforcement."

The ruling also blocked regulations that barred discrimination on the basis of "termination of pregnancy" - abortions.

"The regulations at issue would force doctors to enforce gender transition procedures even on young children, even when doctors believe the procedure is harmful," said Luke Goodrich, an attorney with the Becket Fund for Religious Liberty who represents the plaintiff on the case.

Goodrich called Saturday's preliminary injunction "very significant."

"The beauty of the ruling is it returns those sensitive medical decisions to the doctor and the patient without government intervention, and it respects ultimately the doctor's medical judgment," Goodrich said.

But Young said the impact could be damaging to transgender people seeking care, who for years have faced denial of insurance benefits or access to doctors they chose because of their gender identity. Young said while some states have similar rules protecting transgender rights, Obama's move was "groundbreaking."

"The benefit of the federal law is it sort codifies things and it gave one unifying rule all across the country," he said.