Abortion rights advocates rally outside the U.S. Supreme Court in January 2018. (Ricky Carioti/The Washington Post)

A decades-old North Carolina law that banned women from having abortions after their 20th week of pregnancy is unconstitutional, a federal judge ruled on Monday.

The 1973 law made some allowances for medical concerns, but a 2015 amendment that narrowed those exemptions prompted abortion rights groups to file a lawsuit in 2016.

U.S. District Judge William Osteen sided with the advocacy groups this week, writing that courts across the country have struck down “week- or event-specific abortion bans” and North Carolina’s is no different.

Under the ruling — which will take effect in 60 days, pending an appeal from the state or revised legislation — women will be able to seek abortions at any point before a doctor determines the fetus is “viable” and could be able to survive outside the womb.

Those pushing for greater access to abortions cheered the decision, which comes amid a swell of new restrictions from GOP-led statehouses elsewhere.

“This decision is just a reminder of what the law is,” Andrew Beck, an American Civil Liberties Union attorney who was one of the lawyers fighting the North Carolina law, said in an interview with The Washington Post. “Politicians shouldn’t be meddling with women’s health in a way that’s actually illegal. This decision puts the health and well-being front and center.”

Last week, Mississippi’s Republican governor signed into law what many said was the country’s most restrictive abortion ban yet, a “heartbeat bill” that could ban abortions just six weeks into pregnancy.

Before Mississippi was Kentucky, where, earlier this month, another conservative governor tried to enact a similar measure that a federal judge quickly blocked. This year alone, at least 11 states — including some of the country’s most populous, such as Texas and Florida — have introduced fetal heartbeat legislation.

“There’s been a span of politicians trying to ban abortion whether it’s at six weeks or 20 weeks,” Beck said. “We should all be concerned that there are extreme politicians across the country passing bans on abortion. . . . This is all happening at a state level.”

The raft of new and prospective measures could be a harbinger of battles to come, a back-and-forth bout that right-wing and religious groups hope will end up in the Supreme Court, where a freshly conservative majority could reconsider the Roe v. Wade decision that legalized abortion nationwide.

But decisions such as this week’s in North Carolina give abortion rights groups some comfort, however temporary, that the judicial system will preserve precedent.

“The decision relies solidly on the U.S. Supreme Court rulings that affirm the right to abortion,” Elizabeth Nash, a state issues manager at the Guttmacher Institute, told The Post. “And given that there is so much anticipation that the court will undermine or overturn Roe v. Wade, it is reassuring to see the North Carolina 20-week abortion ban struck down.”

Nash said the legislature’s next move would be telling. Lawmakers in the state’s Republican-controlled House and Senate have about two months and roughly three choices: Appeal the decision and continue the dispute in court, come up with an alternative abortion law, or stand down and let the judge’s ruling take effect.

Spokespeople for top GOP officials told the Associated Press that the party’s leaders were reviewing the decision.

The president of the antiabortion group March for Life said in a statement that she hopes the state appeals the decision.

“The Constitution is designed to protect the rights of all Americans, including the most vulnerable,” Jeanne Mancini said. “From a common sense standpoint, as well as in light of public opinion, it is difficult to understand how anyone could deny basic legal protection, the right to life, to an unborn child who can feel pain and survive outside the womb.”

The ruling is “disappointing but not discouraging,” said Ingrid Duran, the state legislative director for the National Right to Life Committee.

“We will to find ways to protect unborn children in North Carolina and everywhere,” she said.

Advocates have already called 2019 an “unprecedented” year for antiabortion legislation.

Read more:

GOP governor signs law that bans abortion before some women even know they’re pregnant

GOP congressman quotes Hitler’s ‘Mein Kampf’ to slam Trump’s adversaries as liars

Sen. Mike Lee says we can solve climate change with more babies. Science says otherwise.