A North Dakota judge has struck down the state’s near-total abortion ban, ruling that it violates the state’s constitution and clearing the way for the procedure to become legal in the state.

District Judge Bruce Romanick wrote that women have a “fundamental right” to abortion before foetal viability under the North Dakota state constitution.

An abortion clinic filed a legal challenge to the state’s ban, and the North Dakota government attempted to have the lawsuit thrown out.

Enacted last year, the Republican-backed law created exceptions if the mother’s life is threatened, though rape and incest victims were only eligible for an abortion during the first six-weeks of pregnancy.

The abortion law infringes “on a woman’s fundemental right to procreative autonomy”, Judge Romanick wrote in his decision, which also noted that the law had not been “narrowly tailored to promote women’s health or to protect unborn human life”.

He also said the state had not identified “what compelling interest it has informing a woman to carry a pregnancy to term”.

“The law as currently drafted takes away a woman’s liberty and her right to pursue and obtain safety and happiness,” Judge Romanick continued. “The law also impermissibly infringes on the constitutional rights for victims of crimes.”

The order has not yet immediately taken effect, and the decision will likely be appealled against.

No abortion providers currently remain in the state, though the Red River Women’s Clinic – which filed the lawsuit against the state’s abortion ban – is just east of the North Dakota border.

The clinic was previously the only provider in North Dakota, but had to relocate its operations to the neighboring state of Minnesota. It claimed in its lawsuit that the abortion ban was unconstitutionally vague about exceptions.

“The judge clearly understood the depth of our arguments,” said Tammi Kromenaker, clinic director of the Red River Women’s Clinic. “It’s a good day for North Dakota’s pregnant people and we are very pleased.”

Attorneys for the state argued that the case should be thrown out, and that the plaintiff’s case was too hypothetical.

Special Assistant Attorney General Dan Gaustad said in July that the clinic did not have standing because they were now located in Minnesota, the AP reported.

His office did not immediately respond to request for comment.

In 2022, the US Supreme Court overturned its 50-year-old Roe v Wade decision, which had said women’s right to an abortion was protected by the US Constitution.

That allowed individual states to move forward with bans or restrictions on the procedure.

Republican Governor Doug Burgum signed the state’s revised abortion ban into law in April 2023.

Burgum said the law “reaffirms North Dakota as a pro-life state”.