A U.S. District judge in North Carolina overturned an injunction that allowed women to have an abortion after 20 weeks. 

U.S. District Judge William Osteen reinstated an unenforced 20-week abortion ban, with exceptions for urgent medical emergencies, after he said the landmark U.S. Supreme Court decision to overturn Roe v. Wade erased the legal foundation for his 2019 ruling that placed an injunction on the 1973 state law.

North Carolina Abortion Rally

A protest against the Supreme Court's decision in the Dobbs v Jackson Women's Health case passes by a restaurant on June 24, 2022 in Raleigh, North Carolina.  (Allison Joyce/Getty Images)

"Neither this court, nor the public, nor counsel, nor providers have the right to ignore the rule of law as determined by the Supreme Court," wrote Osteen.

Republican General Assembly leaders had urged Osteen to restore the ban in a July 27 friend-of-the-court brief after North Carolina’s Democratic attorney general, Josh Stein, rejected their demand that he bring the ban before a judge himself.

SOUTH CAROLINA SUPREME COURT TEMPORARILY BLOCKS ABORTION LAW AS NEAR-TOTAL BAN MOVES FORWARD IN STATE HOUSE

Before Osteen's ruling, abortions were legal in North Carolina until fetal viability, which generally falls between 24 and 28 weeks of pregnancy, or in certain medical emergencies. 

Osteen's ruling will likely add fuel to an already contentious midterm election year after the Supreme Court’s ruling propelled normally glossed-over state-level politics into the spotlight. 

North Carolina Republicans in November will aim to secure five additional seats they need for a veto-proof supermajority in the state legislature as Democrats stave off their challenges to preserve Democratic Gov. Roy Cooper's power.

CLICK HERE TO GET THE FOX NEWS APP

Cooper and other Democrats have already elevated abortion access as a key campaign issue. The governor signed an executive order in early July shielding out-of-state abortion patients from extradition and prohibiting state agencies under his control from aiding other states' prosecutions of those who travel for the procedure.

The Associated Press contributed to this report