COLUMBIA, Mo. (AP) — A Missouri judge on Monday temporarily blocked a first-of-its-kind rule that would restrict access to gender-affirming health care to children and adults, just hours before it was set to take effect.

St. Louis County Circuit Judge Ellen Ribaudo issued a temporary restraining order blocking enforcement of Republican Attorney General Andrew Bailey’s emergency rule until a lawsuit challenging it is resolved.

In her ruling, Ribaudo wrote that those suing to block the ruling from taking effect “will be subjected to immediate and irreparable loss, damage or injury if the Attorney General is permitted to enforce the Emergency Rule, and its broad, sweeping provisions were implemented without further fact-finding or evidence.”

She wrote that patients “are at high risk of having their medical care interrupted for an unknown length of time; once the Rule goes into effect, they may lose access to medical care through their current providers until such time as the provider can come into compliance with the Rule’s requirements.”

Bailey has touted the rule as a way to shield minors from what he describes as experimental medical treatments, but it also applies to some adults.

Transgender Missourians and health care providers sued to stop it from taking effect. They argued that the rule is discriminatory, and that Bailey sidestepped the Republican-led Legislature and exceeded his authority by attempting to regulate gender-affirming health care under the state’s consumer-protection laws.

This is a breaking news story and will be updated.