A federal judge in Pennsylvania has blocked President Trump's decision to roll back Obamacare's requirement that employers provide birth control to workers at no cost.

The judge for the U.S. Eastern District of Pennsylvania issued the preliminary injunction Friday to halt an interim final rule that severely scales back the mandate.

The decision halts a controversial decision by the Trump administration to let employers not pay for birth control if they have a religious or moral objection.

The Obama administration had let religious organizations such as churches get an exemption from providing birth control. Privately held companies with strong religious objections and religious nonprofits such as charities or universities could get an accommodation, which gave employees access to birth control with the government picking up the tab.

However, a group of religious nonprofits that included the charity Little Sisters of the Poor and Notre Dame University sued the administration over the accommodation. The organizations objected that they still had a role in facilitating access to birth control even though they didn’t have to pay for it.

The case reached the Supreme Court last year, which decided to send the collection of lawsuits back to the lower courts to reach a deal.

Trump’s two interim final rules add moral objections to the reasons for not providing birth control, and expanded it to include any employer.

Pennsylvania was among several states to sue the administration to halt the rollback.

Federal Judge Wendy Beetlestone, who was appointed by Obama, issued the order.

Pennsylvania argued that the rules allow “almost any employer to withhold insurance coverage for contraceptive services,” the order reads.

However, the Trump administration countered the rules are to help employers opt out of covering birth control in health plans because it is a “substantial religious burden.”

Beetlestone found that the state would suffer harm if a preliminary injunction was not granted. The order said that the state would become “obligated to shoulder much of the burden of providing contraceptive services to those women who lose it because their health plans will opt out of coverage.”

The order also said that at least 31,700 women would lose contraceptive coverage under the new rules and that access to “no-cost contraceptive services for many women will be severely curtailed.”