WASHINGTON -- The U.S. Supreme Court on Thursday unanimously preserved access to a medication that was used in nearly two-thirds of all abortions in the U.S. last year, in the court鈥檚 first abortion decision since conservative justices overturned Roe v. Wade two years ago.

The nine justices ruled that abortion opponents lacked the legal right to sue over the federal Food and Drug Administration鈥檚 approval of the medication, mifepristone, and the FDA's subsequent actions to ease access to it. The case had threatened to restrict access to mifepristone across the country, including in states where abortion remains legal.

Justice Brett Kavanaugh, who was part of the majority to overturn Roe, wrote for the court on Thursday that 鈥渇ederal courts are the wrong forum for addressing the plaintiffs鈥 concerns about FDA鈥檚 actions."

Abortion is banned at all stages of pregnancy in 14 states, and after about six weeks of pregnancy in three others, often before women realize they鈥檙e pregnant.

While praising the decision, President Joe Biden signaled Democrats will continue to campaign heavily on abortion ahead of the November elections. 鈥淚t does not change the fact that the right for a woman to get the treatment she needs is imperiled if not impossible in many states,鈥 Biden said in a statement.

And the high court is separately considering another abortion case, about whether a federal law on emergency treatment at hospitals overrides state abortion bans in rare emergency cases in which a pregnant patient鈥檚 health is at serious risk.

More than 6 million people have used mifepristone since 2000. Mifepristone blocks the hormone progesterone and primes the uterus to respond to the contraction-causing effect of a second drug, misoprostol. The two-drug regimen has been used to end a pregnancy through 10 weeks gestation.

Health care providers have said that if mifepristone is no longer available or is too hard to obtain, they would switch to using only misoprostol, which is somewhat less effective in ending pregnancies.

Biden鈥檚 administration and drug manufacturers had warned that siding with abortion opponents in this case could undermine the FDA鈥檚 drug approval process beyond the abortion context by inviting judges to second-guess the agency鈥檚 scientific judgments. The Democratic administration and New York-based Danco Laboratories, which makes mifepristone, argued that the drug is among the safest the FDA has ever approved.

The decision 鈥渟afeguards access to a drug that has decades of safe and effective use,鈥 Danco spokeswoman Abigail Long said in a statement.

The plaintiffs in the mifepristone case, anti-abortion doctors and their organizations, argued in court papers that the FDA鈥檚 decisions in 2016 and 2021 to relax restrictions on getting the drug were unreasonable and 鈥渏eopardize women鈥檚 health across the nation.鈥

Kavanaugh acknowledged what he described as the opponents' 鈥渟incere legal, moral, ideological, and policy objections to elective abortion and to FDA鈥檚 relaxed regulation of mifepristone.鈥

Federal laws already protect doctors from having to perform abortions, or give any other treatment that goes against their beliefs, Kavanaugh wrote. 鈥淭he plaintiffs have not identified any instances where a doctor was required, notwithstanding conscience objections, to perform an abortion or to provide other abortion-related treatment that violated the doctor鈥檚 conscience since mifepristone鈥檚 2000 approval,鈥 he wrote.

In the end, Kavanaugh wrote, the anti-abortion doctors went to the wrong forum and should instead direct their energies to persuading lawmakers and regulators to make changes.

Those comments pointed to the stakes of the 2024 election and the possibility that an FDA commissioner appointed by Republican Donald Trump, if he wins the White House, could consider tightening access to mifepristone.

Abortion rights advocates mainly breathed a sigh of relief after the decision, but they echoed Biden about the impact of the decision two years ago.

鈥淚n the end, this ruling is not a 鈥榳in鈥 for abortion 鈥 it just maintains the status quo, which is a dire public health crisis in which 14 states have criminalized abortion,鈥 Nancy Northup, president and CEO of the Center for Reproductive Rights, said in a statement.

The mifepristone case began five months after the Supreme Court overturned Roe. Abortion opponents initially won a sweeping ruling nearly a year ago from U.S. District Judge Matthew Kacsmaryk, a Trump nominee in Texas, which would have revoked the drug鈥檚 approval entirely. The 5th U.S. Circuit Court of Appeals left intact the FDA鈥檚 initial approval of mifepristone. But it would reverse changes regulators made in 2016 and 2021 that eased some conditions for administering the drug.

The Supreme Court put the appeals court鈥檚 modified ruling on hold, then agreed to hear the case, though Justices Samuel Alito, the author of the decision overturning Roe, and Clarence Thomas would have allowed some restrictions to take effect while the case proceeded. But they, too, joined the court's opinion Thursday.

The push to restrict abortion pills likely won鈥檛 stop with the Supreme Court鈥檚 ruling, said the lawyer who represented anti-abortion doctors and their organizations in the case.

The decision that the doctors don鈥檛 have the legal right to sue leaves open the way for lawsuits from others, including three other states that Kacsmaryk had previously allowed to join the case, said Erin Hawley, an attorney for the group Alliance Defending Freedom.

Hawley said she expects Idaho, Kansas and Missouri to continue the lawsuit originally filed in Texas.

Kansas Attorney General Kris Kobach, a Republican, asserted in a statement that the states have 鈥渟tanding that the doctors did not,鈥 confirming that he will press ahead with the case in Kacsmaryk's court.

Associated Press writer Lindsay Whitehurst contributed to this report.