A federal appeals court blocked the Trump administration’s religious and moral exceptions to the Obamacare birth control mandate from being implemented in five states.

On Thursday, a split three-judge panel of the U.S. Court of Appeals for the Ninth Circuit upheld a preliminary injunction by the district court. Judges John Clifford Wallace, a Richard Nixon nominee, and Susan Graber, an appointee of Bill Clinton, upheld the district court’s ruling.

The decision allows the states of California, Delaware, Virginia, Maryland, and New York to ignore the Trump administration’s rules that protect employers with religious or moral objections to abortion-inducing drugs and birth control from being forced to provide them to workers.

In the majority opinion, Wallace wrote that women who are denied free birth control through employer health insurance plans will end up costing states more money.

“The declarations submitted by the states further show that women losing coverage from their employers will turn to state-based programs or programs reimbursed by the state,” he wrote, though he added that the record did not support affirming the district court’s ruling on a nationwide basis.

The dissenting judge, Andrew Kleinfeld, a George H.W. Bush appointee, said the states lack standing in the case because their problem of incurring more costs for contraception that may result from the Trump administration’s rules is “self-inflicted.” The problem occurred for the states, according to the dissent, because lawmakers decided to promise free birth control to women in response to the release of the Trump administration’s rules.

“The reason they lack standing is that their injury is what the Supreme Court calls ‘self-inflicted,’ because it arises solely from their legislative decisions to pay these moneys,” Kleinfeld wrote, adding:

The federal regulatory change itself imposes no obligation on the states to provide money for contraception. The plaintiff states choose to provide some contraception benefits to employees of employers exempted by the federal insurance requirement, so the narrowing of the federal mandate may lead to the states spending more because some employers may spend less.

Planned Parenthood celebrated the ruling on Twitter:

This is a win! Access to birth control is crucial, and the admin's interim rules to roll back birth control coverage are harmful and show their disdain for our health care. We won't stop fighting to protect our care. #fight4birthcontrol #courtsmatter https://t.co/VCxbfl8aPG — Planned Parenthood Action (@PPact) December 13, 2018

In November, Trump’s Departments of Health and Human Services (HHS), Labor, and the Treasury issued two rules intended to protect those with religious or moral objections to Obamacare’s mandate for most employers to provide abortion-inducing drugs, contraceptives, or sterilization procedures – free of charge – to employees via health insurance plans.

The first rule provided an exemption from the contraceptive coverage mandate to entities that object to services covered by the mandate on the basis of faith beliefs. The second final rule provided protections to nonprofit organizations and small businesses that have non-religious, moral convictions opposing the services covered by the mandate.

The religious and conscience exemptions provided by these rules also applied to institutions of education, issuers, and individuals. The rules were scheduled to go into effect at the start of 2019.

The Trump administration can now petition the Supreme Court to take up the case.

The case is California v. Azar, No. 18-15166, in the U.S. Court of Appeals for the Ninth Circuit.