(Reuters) - A U.S. federal court struck down North Carolina’s decades-old ban on abortions after 20 weeks of pregnancy, saying any “week- or event-specific” abortion ban is unconstitutional.

An abortion rights activist holds up a sign as marchers take part in the 46th annual March for Life in Washington, U.S., January 18, 2019. REUTERS/Joshua Roberts

The law, which took effect in 1973, only allowed an abortion after 20 weeks in the case of a medical emergency. Abortion-rights groups sued in 2016 after the health exception was further narrowed.

U.S. District Judge William Osteen in Greensboro overturned the ban on Monday, allowing an abortion to take place at any point before the fetus is viable, or able to potentially live outside the womb, as determined by a doctor.

His order will take effect in 60 days, allowing the state to appeal, should it decide to do so, or to propose alternative abortion legislation.

Citing U.S. Supreme Court precedent, Osteen wrote “a state is never allowed to prohibit any swath of pre-viability abortions outright, no matter how strenuously it may believe that such a ban is in the best interests of its citizens or how minimal it may find the burden to women seeking an abortion.”

Laura Brewer, a spokeswoman for the North Carolina attorney general’s office, said her office was reviewing the decision.

The groups that brought the lawsuit - the Center for Reproductive Rights, the American Civil Liberties Union and Planned Parenthood - welcomed the decision.

“This ban is unconstitutional and ignores the unique circumstances, challenges, and potential complications pregnant women face,” Genevieve Scott, a staff attorney at the Center for Reproductive Rights, said in a statement on Tuesday. “Politicians taking medical options off the table for women at any stage of pregnancy is irrational and dangerous.”

The ruling appeared to thwart a bill brought by Republican lawmakers in North Carolina earlier this year that would have banned abortions after 13 weeks.

Several Republican-controlled states have attempted to pass new abortion restrictions. In a law enacted earlier this month, Mississippi banned a woman from obtaining an abortion once a fetal heartbeat is detected.

Some conservatives hope these laws will end up being used to challenge Roe v. Wade, the Supreme Court’s 1973 landmark ruling that women have a constitutional right to an abortion.