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

Now this week, Alabama has voted to effectively ban 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 America.

“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, when 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 nationwide, experts count about 30 abortion laws that have gone into effect. 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.

“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.

Fetal heartbeat bills had been at the fringes of the anti-abortion movement for years. 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 hard for it. Its legal chances seemed slim, given the direct challenge it presented to established 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, including one in Louisiana that cleared a hurdle Wednesday.

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,” said Michael Gonidakis, president of Ohio Right to Life in Columbus, on Wednesday.

He pointed out that Trump has 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.”

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.”

State Rep. Kelly Cassidy, a co-sponsor of the Illinois bill, said she remained hopeful that it would be passed before the legislative session ends May 31.

This article originally appeared in The New York Times.