Chief Justice John Roberts joined the Supreme Court’s liberal wing on Thursday in temporarily blocking a Louisiana law that would have placed restrictions on abortion clinics, in the high court’s first major ruling on abortion since the confirmation of Associate Justice Brett Kavanaugh.

The ruling comes as Roberts, who was appointed by President George W. Bush, has increasingly and deliberately sought to present the federal judiciary as nonpartisan, amid a flurry of attacks from progressive groups arguing that the Supreme Court’s new conservative majority imperils the country. Last year, in a highly unusual statement,Roberts rebuked President Trump for criticizing partisanship in the federal judiciary.

The Louisiana law is virtually identical to a Texas measure the justices struck down three years ago by a 5-3 vote, shortly after the death of Justice Antonin Scalia. Roberts dissented in that case, when he was not the deciding vote, and sided with the conservative minority that wanted to uphold the anti-abortion law — making his decision on Thursday a significant reversal.

The justices decided in a 5-4 vote on Thursday, with Roberts as the swing vote, that they will not allow Louisiana to put into effect a law that requires abortion providers to have admitting privileges at nearby hospitals. The Supreme Court is set to issue a final ruling on the merits of the case later, and Thursday’s majority ruling did not spell out a rationale.

In the 2016 Texas case, the Supreme Court held that the admitting-privileges requirement “provides few, if any, health benefits for women, poses a substantial obstacle to women seeking abortions, and constitutes an ‘undue burden’ on their constitutional right to do so.”

Anti-abortion activists protest outside of the U.S. Supreme Court, during the March for Life in Washington last month. (AP Photo/Jose Luis Magana, File)

Anti-abortion activists protest outside of the U.S. Supreme Court, during the March for Life in Washington last month. (AP Photo/Jose Luis Magana, File)

The court’s four more conservative justices, including Neil Gorsuch and Kavanaugh, would have allowed the Louisiana law to take effect. Kavanaugh wrote a dissent explaining his vote, saying that while he respects the 2016 precedent, the court’s action was premature because the state had made clear it would allow abortion providers an additional 45 days to obtain admitting privileges before it started enforcing the law.

If the doctors succeed, they can continue performing abortions, but if they fail, they could return to court, Kavanaugh wrote. The other conservative justices, although they dissented, did not join Kavanaugh’s opinion.

“The parties have offered, in essence, competing predictions” about what would happen if the law were implemented, Kavanaugh said in his dissent. “If we denied the stay [and allowed the law to be implemented], that question could be readily and quickly answered without disturbing the status quo or causing harm to the parties or the affected women, and without this court’s further involvement.”

ANALYSIS: ROBERTS’ REBUKE OF TRUMP WAS HIGHLY POLITICAL AND INAPPROPRIATE

The law was set to take effect Monday, but last Friday, Justice Samuel Alito temporarily halted its implementation so that the justices could review arguments.

Observers said that at least one and maybe two of Louisiana’s three abortion clinics would have to close if the law were allowed to take effect. A federal appeals court that upheld the law, however, said it’s not clear that any clinic would close.

The chief justice’s overt attempts to project ideological balance on the Supreme Court have heightened since the contentious confirmation of Kavanaugh ostensibly gave conservatives a 5-4 majority on the Supreme Court.

Many pro-choice groups claimed that Kavanaugh’s confirmation amounted to a cataclysmic event, with the far-left progressive political action committee Democracy for America warning of the imminent “deaths of countless women.”

Associate Justice Brett Kavanaugh with Chief Justice John Roberts.

Associate Justice Brett Kavanaugh with Chief Justice John Roberts. (File)

TRUMP: NINTH CIRCUIT WOULD OVERTURN MY TURKEY PARDON IF IT COULD

Last November, Roberts openly disputed President Trump’s comments that the nation has “Obama judges” and partisan hacks on the courts. The move marked a highly unusual challenge to the White House from a sitting Supreme Court justice, and prompted some observers to accuse Roberts of naivete.

“What we have is an extraordinary group of dedicated judges doing their level best to do equal right to those appearing before them,” Roberts said in the head-turning statement.

But Trump, who has long attacked the liberal Ninth Circuit Court of Appeals as biased and a “total disaster,” fired back immediately.

“Sorry Chief Justice John Roberts, but you do indeed have ‘Obama judges,’ and they have a much different point of view than the people who are charged with the safety of our country,” Trump tweeted.

“It would be great if the 9th Circuit was indeed an ‘independent judiciary,’ but if it is why are so many opposing view (on Border and Safety) cases filed there, and why are a vast number of those cases overturned,” Trump continued. “Please study the numbers, they are shocking. We need protection and security – these rulings are making our country unsafe! Very dangerous and unwise!”

The debate over the Louisiana bill comes amid a renewed national debate on abortion law.

Senate Democrats on Monday blocked a GOP effort to introduce a billl meant to protect abortion survivors, which came in response to comments last week by Virginia Democratic Gov. Ralph Northam that seemingly endorsed post-birth abortions in certain cases.

Nebraska Republican Sen. Ben Sasse sought unanimous consent to pass the Born-Alive Abortion Survivors Protection Act, which would have required that “any health care practitioner present” at the time of a birth “exercise the same degree of professional skill, care, and diligence to preserve the life and health of the child as a reasonably diligent and conscientious health care practitioner would render to any other child born alive at the same gestational age.”

CLICK TO GET THE FOX NEWS APP

The bill, which exempted the mother involved in the birth from prosecution, also would have required practitioners to “ensure that the child born alive is immediately transported and admitted to a hospital.” It prescribed a possible term of imprisonment of up to five years for violations, not including penalties for first-degree murder that could also apply.

Democrats dismissed the bill as little more than a political stunt.

Fox News’ Andrew O’Reilly and The Associated Press contributed to this report.