Days later, Ohio passed a bill banning abortion in the very early weeks of pregnancy after a fetal heartbeat is detected.

And Wednesday, Gov. Kay Ivey of Alabama signed a bill effectively banning the procedure altogether.

States across the country are passing some of the most restrictive abortion legislation in decades, deepening the growing divide between liberal and conservative states and setting up momentous court battles that could profoundly reshape abortion access in the United State.

“This has been the most active legislative year in recent memory,” said Steven Aden, general counsel of Americans United for Life, an anti-abortion group.

The national race to pass legislation began last fall, after President Donald Trump chose Brett Kavanaugh to replace Justice Anthony Kennedy on the Supreme Court, adding what some predicted would be a fifth vote to uphold new limits on abortion. Red states rushed to pass more restrictions and blue states to pass protections.

Now, as state legislative sessions draw to a close in many places, experts count about 30 abortion laws that have passed so far.

That is not necessarily more than in past years, said Elizabeth Nash, a legal expert at the Guttmacher Institute, which supports abortion rights.

What’s different is the laws themselves, which have gone further than ever to frontally challenge Roe v. Wade, the Supreme Court’s 1973 ruling that established federal protections for abortion.

And more are coming. Legislation is moving this week in statehouses in Louisiana and Missouri. On Wednesday, abortion rights activists demonstrated outside a chamber in the Louisiana House in Baton Rouge after a committee advanced a so-called fetal heartbeat bill.

“This is a very serious situation,” Nash said. “We are really facing a point at which the courts may make a shift on abortion rights.”

For years, state legislatures have taken bites out of abortion access through laws that often failed in the courts. But over time, the courts have grown more sympathetic, and a broad swath of the country’s middle and south now has minimal access to the procedure. Six states each have only one abortion clinic left: Kentucky, Mississippi, Missouri, North Dakota, South Dakota and West Virginia.

But Trump’s changes on the Supreme Court have altered the terms of the fight, filling anti-abortion activists with hope that their 40-year effort to overturn Roe entirely might finally succeed.

“There are many states that believe that the time is now for the Supreme Court to reconsider the blanket prohibition that Roe v. Wade expressed,” Aden said.

In Alabama, Ivey signed the law, saying it “stands as a powerful testament to Alabamians’ deeply held belief that every life is precious, that every life is a sacred gift from God.”

One clear sign of change is the way fetal heartbeat bills, once at the fringes of the anti-abortion movement, have become mainstream for Republican-controlled states. Ohio became the first state to try to pass one in 2011, but the state’s largest anti-abortion group, Ohio Right to Life, didn’t even push for it. Its legal chances seemed slim, given the direct challenge it presented to Supreme Court precedent.

That changed last year when Trump named Kavanaugh to the court. A heartbeat bill sped through the Ohio Legislature this year and was signed into law by Gov. Mike DeWine in April.

Three other states have passed such laws this year: Georgia, Kentucky and Mississippi. More are moving through the legislatures of 11 states, Nash said.

Many of the laws being passed to restrict abortion will not go into effect, at least not now. Abortion rights advocates are challenging them in court. But anti-abortion campaigners say that’s exactly the outcome they want.

“There’s only one way to get a case before the U.S. Supreme Court — someone has to sue us, and that happened today,” Michael Gonidakis, president of Ohio Right to Life in Columbus, said Wednesday.

He pointed out that Trump had appointed several judges to the 6th U.S. Circuit Court of Appeals, often a crucial final stop before the Supreme Court. “We are very encouraged that we are going to have great success,” Gonidakis said.

B. Jessie Hill, a lawyer who helped file a legal challenge to Ohio’s law on behalf of the American Civil Liberties Union on Wednesday, said: “I genuinely think that the future of Roe is the most precarious it has ever been since 1973.”

Some anti-abortion activists believe states have gone too far in pushing restrictions that directly challenge Roe. There’s no guarantee that the Supreme Court would rule in their favor, they say, and the energy could be better spent on other things.

“Events have overtaken us,” said Samuel Lee, an anti-abortion lobbyist in Missouri. “The advice of lawyers is of less concern than it ever has been in the pro-life movement right now. Sometimes people just want something. Social movements can take on a life of their own.”

Liberal-leaning states are moving, too. Nash said about nine states are considering some type of legislation that would strengthen abortion rights. New York passed a law protecting abortion in later stages of pregnancy, and similar laws are moving in Vermont and Rhode Island. Some states, including Nevada and New Mexico, are also working to repeal old restrictions that have been on the books for decades, to prevent them from being enforced if Roe is overturned.

On Wednesday morning, about 100 reproductive health care providers and advocates fanned out across the Illinois state Capitol to urge lawmakers to take up the Reproductive Health Act, which would protect abortion rights.

After visiting four offices, Dr. Erin King, executive director of Hope Clinic for Women in Granite City, said preserving abortion rights in Illinois was important because so many surrounding states have passed restrictive laws, and women travel to clinics in Illinois for care.

“Every time I go to sleep and wake up, there is a new law in a state around us that is either restricting abortion further or essentially banning it,” she said. “If you told me this was going to happen a year ago, I would not have believed it.”

It’s not the first time that activists in the abortion movement believed Roe was about to be overturned. When the Supreme Court took up Planned Parenthood v. Casey, a case it ruled on in 1992, both sides of the issue felt certain that it would mean the end of federal abortion protections. Instead, it affirmed them while opening the door for individual states to regulate at later stages of pregnancy.

But nearly 30 years later, the country’s politics have grown more polarized. Before, some moderate Republicans supported abortion and some conservative Democrats opposed it. Now that political middle has all but disappeared.

While similar legislation is popping up everywhere, each state has its own unique politics.

The signing of a six-week fetal heartbeat ban by Gov. Brian Kemp of Georgia came after a long period of relative quiet on the abortion front in the state. The last major abortion law that passed in the state was in 2012. But Kemp’s narrow victory in November over Stacey Abrams, a Democrat, changed things. An underdog candidate in the Republican primary, Kemp rocketed to victory with hard-right messaging that included a promise to personally round up immigrants in the country illegally and, significantly, to sign a heartbeat bill outlawing abortions after six weeks.

“He wanted to establish his conservative credentials, and to do that you have to check the abortion box,” said Stacey Evans, a Democrat and former member of the Georgia House who ran in the Democratic primary for governor last year. “And he did.”

The Georgia law might get caught up in court. But Dr. Atsuko Koyama, a pediatrician based in Atlanta who provides abortions in a separate practice, believes that the Georgia law is having an effect anyway — by scaring and confusing patients.

“There’s definitely been some people who have been scared that maybe we’d turn them away,” Koyama said, “but we’re very quick to reassure them that we’re open for business.”

This article originally appeared in The New York Times.