Abortion will remain legal in Wyoming — at least temporarily — after a judge on Wednesday ordered that a newly enacted ban be blocked until further court proceedings in a lawsuit challenging it.

After a three-hour hearing, Judge Melissa Owens of Teton County District Court granted a temporary restraining order, pausing a law that took effect Sunday. The law would make providing almost all abortions a felony punishable by up to five years in prison.

The lawsuit — filed by six plaintiffs, including four health care providers — also challenges another law, scheduled to take effect on July 1, that would make Wyoming the first state to explicitly ban the use of pills for abortion. Now, the medication abortion ban and the overall ban will be considered at a hearing where the plaintiffs will seek an injunction to suspend both laws until the full lawsuit can be heard.

A central issue is whether Wyoming’s Constitution allows the legislature to ban nearly all abortions, when the Constitution includes an amendment that guarantees adults the right to make their own health care decisions. An overwhelming majority of Wyoming citizens voted for the amendment in 2012.

Similar battles over the constitutionality of state abortion plans have been playing out in other conservative states. In South Carolina and North Dakota, courts have ruled that abortion bans violate those states’ constitutions. In Idaho, courts have upheld the state’s abortion ban.

Last year, Judge Owens blocked a previously enacted abortion ban, and a hearing on that is scheduled for December. The new ban, enacted earlier this month, was the legislature’s attempt to circumvent the constitutional guarantee of freedom in health care choices by declaring in the law that abortion is not health care.

On Wednesday, Judge Owens questioned that assertion. “I’m just still hung up on abortion not being health care,” she said to the lawyer defending the laws for the state, Jay Jerde, a special assistant attorney general for Wyoming.

“An abortion can only be performed by a licensed medical professional, so what authority does the legislature have to declare that abortion is not health care when our laws only allow a licensed medical professional to administer one?” she asked.

Regarding medication abortion, she noted that abortion pills are regulated by the Food and Drug Administration. “How is a doctor actually prescribing those pills not health care?” she asked.

Mr. Jerde said the legislature’s premise was that “intentional killing of an unborn child cannot be considered to be health care.”

“I would concede that if you focus just on the pregnant woman, it becomes a little bit easier to say, well, this has to be health care,” he continued. “But if you view it from that other perspective, it clearly is not.”

The plaintiffs include Dr. Giovannina Anthony, an obstetrician-gynecologist at the only clinic in Wyoming, in Jackson, that has been providing abortions, and Wellspring Health Access, a clinic that plans to open soon in Casper and offer abortions.

Wellspring had intended to open last year, but its building was damaged by an arsonist last May, a case that remained unsolved for months. On Wednesday, federal authorities said they had charged Lorna Roxanne Green, 22, from Casper with arson in the case. Ms. Green told an agent with the federal Bureau of Alcohol, Tobacco, Firearms and Explosives that she opposed abortion and had nightmares over the prospect of the clinic opening, and that she poured gasoline around the site and lit it on fire, according to a court document described Thursday by the Associated Press.

The other plaintiffs are another obstetrician-gynecologist who often treats high-risk pregnancies; an emergency room nurse; a fund that gives financing to abortion patients; and a woman who said her Jewish faith requires access to abortion if a pregnant woman’s physical or mental health or life is in danger.

John Robinson, a lawyer for the plaintiffs, told Judge Owens that both the overall ban and the medication abortion ban violate several constitutional provisions because they “attempt to strip women of their rights to equality, health care and religion during a very specific life cycle, from conception to birth.”

He said the laws signal that during pregnancy “the legislature does not consider the woman an equal member of the human race and Wyoming.”

Mr. Jerde argued that the laws did not violate the constitutional provisions that the plaintiffs cited. He also said the implications of the plaintiffs’ arguments would be that a person with a health condition that might be treated with marijuana “would be free to possess and consume marijuana, regardless of the state laws that prohibit it and criminalize it.”

Judge Owens said that only courts can decide whether the laws are constitutional.

“To declare abortion is not health care when there may be evidence to show that it is — the legislature cannot make an end run around essentially providing a constitutional amendment,” she said, adding “the state cannot legislate away a constitutional right. It’s not clear if abortion is or isn’t health care, and the court has to then decide that.”