BISMARCK, N.D. (AP) — A federal appeals court affirmed a ruling Wednesday that struck down one of the strictest anti-abortion laws in the country: a North Dakota law that bans abortions when a fetal heartbeat can be detected, which can be as early as six weeks into a pregnancy.

The 8th U.S. Circuit Court of Appeals agreed with a decision last year from U.S. District Judge Daniel Hovland, who ruled the law unconstitutional. The law was approved by the Republican-dominated Legislature in 2013, though it was quickly put on hold after the state’s lone abortion clinic filed a lawsuit that July.

North Dakota is among several conservative states that have passed new abortion restrictions in recent years, butabortion rights supporters say North Dakota’s fetal heartbeat law is the most restrictive in the country.

Supporters said the law was meant to challenge the U.S. Supreme Court’s 1973 ruling that legalized abortion until a fetus is considered viable, usually at 22 to 24 weeks. It wasn’t immediately clear whether the state would appeal the case, though lawmakers have set aside $800,000 to defend the state’s abortion laws.

The court heard arguments in the case in January, on the same day it considered a challenge to a fetal heartbeat law in Arkansas that bans abortions at 12 weeks. The 8th Circuit struck down Arkansas’ law in May, but it didn’t rule on the more restrictive North Dakota law.

North Dakota’s law was among several anti-abortion measures approved by lawmakers and Republican Gov. Jack Dalrymple in 2013 to make North Dakota’s abortion laws among the strictest in the nation.

Dalrymple has called the law “a legitimate attempt by a state Legislature to discover the boundaries of Roe v. Wade.” But opponents say it’s an attempt to shutter the state’s only abortion clinic: the Red River Clinic in Fargo, in far eastern North Dakota. The clinic is backed in its legal fight by the New York-based Center for Reproductive Rights.

North Dakota lawmakers set aside $400,000 to defend lawsuits arising from the new abortion laws in 2013, and the Legislature added another $400,000 this year. Records obtained by The Associated Press show that the state has spent $312,861 defending the abortion laws as of June, including nearly $233,000 on the fetal heartbeat measure.

The Fargo clinic, which performs about 1,250 abortions a year, is served by out-of-state physicians licensed to practice in North Dakota. The nearest abortion clinics are four hours south in Sioux Falls, South Dakota, and four hours southeast in Minneapolis.

Tammi Kromenaker, director of the Fargo clinic, has said confusion over the new abortion laws affected procedures in 2013; she said many people thought the law banned abortions. She said abortion numbers in 2014 have returned to normal.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.