Washington CNN  — 

Chief Justice John Roberts sided with the liberal justices on the Supreme Court on Monday to block a controversial Louisiana abortion law that critics said would have closed nearly every clinic in the state.

The 5-4 ruling is a win for supporters of abortion rights who argued that the law was not medically necessary and amounted to a veiled attempt to restrict abortion. The law barred doctors from performing the procedure unless they had admitting privileges at a nearby hospital.

The majority opinion was penned by Justice Stephen Breyer, who wrote that the majority “consequently hold that the Louisiana statute is unconstitutional.”

Breyer added later: “The evidence also shows that opposition to abortion played a significant role in some hospitals’ decisions to deny admitting privileges.”

The ruling continues a trend of Roberts siding with liberals in major cases. He previously has upheld the program allowing undocumented immigrants who came into the US as children to remain and sided with opinion that extended anti-discrimination protections to LGBTQ workers.

Four years ago, when Justice Anthony Kennedy was still on the bench, the court struck down a similar law out of Texas.

Much has changed since then, however, as Kennedy has been replaced by Brett Kavanaugh, who is considered more conservative on the issue. Supporters of abortion rights feared not only that recent precedent would be in jeopardy, but that the strengthened conservative majority might begin to chip away at landmark opinions like Roe v. Wade and Planned Parenthood v. Casey, which upheld a woman’s right to have an abortion.

Roberts wrote a separate concurring opinion also citing the Texas law.

“The Louisiana law imposes a burden on access to abortion just as severe as that imposed by the Texas law, for the same reasons. Therefore Louisiana’s law cannot stand under our precedents,” the chief justice wrote.

In a dissent, Justice Clarence Thomas again said Roe should be revisited.

“Roe is grievously wrong for many reasons,” Thomas wrote, “but the most fundamental is that its core holding – that the Constitution protects a woman’s right to abort her unborn child – finds no support in the text of the Fourteenth Amendment.”

White House press secretary Kayleigh McEnany blasted the ruling as “unfortunate,” and took aim at the justices who sided with the majority.

“Instead of valuing fundamental democratic principles, unelected Justices have intruded on the sovereign prerogatives of state governments by imposing their own policy preference in favor of abortion to override legitimate abortion safety regulations,” McEnany said in a statement.

The case has been closely watched as multiple largely red states continue to advance abortion restrictions and largely blue states move to protect access.

None of the nine so-called gestational bans – which bar abortions past a certain point in pregnancy – passed last year have gone into effect, after most of them have been blocked by courts.

Roberts’ footnotes leave an opening

Abortion rights supporters were fearful that the Louisiana case marked the first of what could be a growing number of opportunities for the court’s new conservative majority to offer a blueprint for states to continue to chip away at abortion rights.

But while Roberts struck down the law, in a concurring opinion the chief justice left open the door that other states might be able to pursue similar restrictions.

In a footnote, he said that the “validity of admitting privileges law depends on numerous factors that may differ from state to state.”

CNN Supreme Court analyst and professor at the University of Texas School of Law Stephen Vladeck said that Roberts suggested that he did not necessarily endorse the analysis of the 2016 decision, which focused as much on whether the restrictions actually provided benefits to pregnant women as on whether they imposed an undue burden.

“In the process, Vladeck said, “the chief justice’s narrower opinion implies that states making different arguments in different cases might be able to justify similar restrictions going forward. In that respect, the chief justice may have sided with abortion supporters today, but their victory may be short-lived.”

While supporters of abortion rights will be pleased that the court preserved access to abortion in Louisiana, such language has already caused concern.

The Center for Reproductive Rights, which brought the case, addressed the looming possibility it allowed for further state regulations similar to Louisiana’s in a statement Monday morning.

“We’re relieved that the Louisiana law has been blocked today but we’re concerned about tomorrow,” said Nancy Northup, the group’s president and CEO.

“(The) Court’s decision could embolden states to pass even more restrictive laws when clarity is needed if abortion rights are to be protected,” Northup said.

Anti-abortion groups decried the decision and warned of its implications energizing anti-abortion voters in November.

Jeanne Mancini, the president of March for Life, defended the Louisiana law as “designed to safeguard women’s health and safety” and promised a strong showing from anti-abortion voters over the decision.

“No abortion facility should receive a free pass to provide substandard care,” she added. “This decision underscores the importance of nominating and confirming judges who refrain from legislating from the bench, something pro-life voters will certainly remember come November.”

The law’s impact

Louisiana’s Unsafe Abortion Protection Act, is an effort, state officials argued, to “improve abortion safety by means of doctor credentialing.”

Louisiana Solicitor General Elizabeth B. Murrill said that clinics in the state have a “long disturbing” history of serious health and safety problems, that abortion carries “known risks for serious complications,” although it is largely considered a safe procedure, as Justice Ruth Bader Ginsburg noted during oral arguments, and that the act would bring abortion practice “into conformity” with the privilege requirements for doctors performing other outpatient surgeries. The penalty for violating the law is not more than $4,000 per violation.

The Trump administration sided with Louisiana. The law “would not create a substantial obstacle to obtaining an abortion for a large fraction of Louisiana women seeking one – let alone all such women,” Principal Deputy Solicitor General Jeffrey Wall argued in court.

The claims were rejected by lawyers for the Center for Reproductive Rights, which represented two doctors and an abortion clinic in the state who claimed that if the law had been able to go into effect when it passed, it would have forced the closure of two of the state’s three remaining clinics and left only one doctor with the ability to provide abortions.

Louisiana also argued that the justices shouldn’t consider the constitutionality of the law because the doctors and the clinics bringing the case don’t have the legal right – or “standing” – to be in court. Murrill said that Louisiana women can challenge abortion regulations if they wish to do so – “as individual women have done in numerous other abortion cases across the country” – but that the clinics and doctors can’t stand in their place. She said that’s because the interests of a for-profit business that provides medical services for a fee might not align with those of patients seeking abortions.

Julie Rikelman, an attorney with the Center for Reproductive Rights, rejected the notion that only women seeking abortions could challenge the law in court, noting that a woman would have only a narrow time frame to bring such a suit and such litigation often lasts for years.

Rikelman prevailed when a district court ruled in her favor after a trial, but then a panel of judges on the 5th US Circuit Court of Appeals reversed the decision. The appeals court concluded that the doctors had not made a good faith effort to get the credentials.

“Instead of demonstrating an undue burden on a large fraction of women,” the appeals court said, the law “at most shows an insubstantial burden on a small fraction of women.”

This story has been updated with details of the ruling.

CORRECTION: This story has been updated to accurately explain John Roberts’ vote.

CNN’s Betsy Klein contributed to this report.