The war over abortion access has mostly fallen to the states in the four decades since Roe v. Wade first legalized abortion across the country. But now that Anthony Kennedy, the longstanding swing justice of the Supreme Court, plans to retire at the end of July, that fight now threatens to go federal.

With Kennedy’s retirement, President Donald Trump has a chance to nominate his second justice to the high court. And he’s promised to only appoint strong conservatives who would overturn Roe v. Wade if they get the chance. Luckily for them, anti-abortion lawmakers have spent the past few years trying to pass extreme restrictions to trigger litigation that could one day end up at the Supreme Court.

And if the justices do overturn the landmark 1973 case, abortion could once again be illegal in 13 states and have its access strongly curtailed across much of the United States.

“Justice Kennedy’s retirement from the Supreme Court marks a pivotal moment for the fight to ensure every unborn child is welcomed and protected under the law,” Marjorie Dannenfelser, president of the anti-abortion group Susan B. Anthony List, said in a statement.

In her own statement, NARAL Pro-Choice America President Ilyse Hogue chimed in, saying, “Because President Trump will nominate the next Supreme Court Justice, a woman’s constitutional right to access legal abortion is in dire, immediate danger — along with the fundamental rights of all Americans.”

Leslie Xia for VICE News

Between January 2011 and January 2018, state legislatures enacted 401 abortion restrictions; those account for 34 percent of all abortion restrictions passed in the four decades since Roe v. Wade, according to the Guttmacher Institute. These restrictions have chipped away at abortion access for years — for example, a Texas law regulating the state’s abortion clinics forced 21 of the state’s 40 abortion clinics to close in just three years, the Texas Tribune reported.

In recent years, however, lawmakers have proposed more extreme abortion restrictions, including outright bans on certain kinds of abortions. Nine states, including several in recent years, have passed bills to ban a common second-trimester abortion method; courts have blocked all but two of those states’ restrictions, on the grounds that banning the procedure essentially erases women’s access to second-trimester abortion.

Iowa Gov. Kim Reynolds signed a bill into law in May that banned abortion after the detection of a fetal heartbeat, which is only about six weeks into pregnancy. But a judge soon blocked it from going into effect, thanks to a lawsuit brought by Planned Parenthood and the state’s American Civil Liberties Union chapter. That didn’t surprise lawmakers who supported the bill, some of whom openly said they wanted to use the bill to kick off litigation.

“We created an opportunity to take a run at Roe v. Wade — 100 percent,” Iowa Republican state Sen. Rick Bertrand told Reuters shortly after the bill passed the state legislature. “We need to create vehicles that will allow the Supreme Court possibly to reach back and take this case, and to take up an anti-abortion case,” he added to the New York Times.

At least six states have also recently proposed or passed laws banning abortion whenever a fetus is diagnosed with Down syndrome, though several have been blocked from taking effect.

Right now, the Center for Reproductive Rights has 20-odd lawsuits over state-level abortion restrictions in various state and federal courts around the country, including one over Mississippi’s 15-week ban. Some of these lawsuits — or one of the dozens of others brought by pro-abortion rights groups — could eventually rise to the Supreme Court.

“The Supreme Court could hear a case on abortion rights in the next year or two,” said Julie Rikelman, the center’s senior director of litigation. “The stakes really couldn’t be higher at this moment in time.”

“The lawsuits necessary to overturn Roe and criminalize abortion, as well as some forms of contraception, are already moving through the courts,” added NARAL Pro-Choice America’s Hogue, in a Thursday statement.

"Justice Kennedy’s retirement from the Supreme Court marks a pivotal moment for the fight to ensure every unborn child is welcomed and protected under the law."

If Roe v. Wade were to be set aside, the debate over abortion’s legality would fall to the states. Abortion could automatically become outright illegal in up to 13 states. Four states have passed so-called “trigger laws,” which would instantly outlaw abortion as soon as Roe is repealed, according to the Guttmacher Institute. Ten have also banned abortion prior to Roe v. Wade, and may revert back to those bans. (Mississippi has both.)

Rachel Zigler is an OB-GYN and abortion provider in Missouri, whose state legislature held a special section devoted to passing abortion regulations just last summer. (Missouri is also one of seven states that have also passed laws that, if Roe disappears, express their plan to limit abortion as much as possible.) She isn’t sure what she’d do if Roe v. Wade disappears, leaving Missouri free to ban abortion.

“So much has happened in the last two years where we’ve sat back and said, ‘Oh, no, that’ll never happen,’” said Zigler, who's also a fellow with Physicians for Reproductive Health. “Anything is possible. And that we just have to prepare for that.”