A North Dakota judge struck down the state’s near-total ban on abortion Thursday, saying the state constitution gives women a “fundamental right to choose abortion” before fetal viability. Restrictions on the right is “a violation on medical freedom,” he ruled.

State District Judge Bruce Romanick declared the law, enacted by the legislature last year, “unconstitutionally void for vagueness.” The statute made the procedure illegal in all cases except rape or incest when the woman has been pregnant for less than six weeks or when the pregnancy poses a serious physical health threat. Doctors and other health care professionals found to be in violation of the law could be charged with a felony — and then face up to five years in prison and a maximum fine of $10,000.

In the conservative state, where lawmakers have twice passed bans that courts subsequently ruled against, the victory for abortion rights supporters was a bittersweet one. North Dakota no longer has any abortion clinics; its onetime sole provider and plaintiff in the lawsuit, the Red River Women’s Clinic, moved from Fargo to Moorhead, Minn., in 2022.