A federal judge in Philadelphia on Monday barred the Trump administration from implementing new rules that would let almost any employer deny female employees coverage for birth control by citing religious or moral objections.

U.S. District Judge Wendy Beetlestone found that the regulations could result in unplanned pregnancies and as many as 127,000 women losing access to no-cost contraception, which is mandated under the Affordable Care Act. She also concluded that the impact would inflict an undue financial burden on states that moved to pick up the tab.

In a 65-page opinion, the judge granted the nationwide temporary injunction sought by the attorneys general of Pennsylvania and New Jersey.

“The negative effects of even a short period of decreased access to no-cost contraceptive services is irreversible,” she wrote.

Beetlestone’s ruling came on the same day the regulations took effect, carving out religious and moral exemptions to the Obamacare contraception mandate.

It followed a similar order issued late Sunday by a federal judge in California. But unlike Judge Haywood S. Gilliam’s decision in that case – which only applied to the 13 states and the District of Columbia, who filed suit in his court – Beetlestone expanded the scope of her decision to cover the country.

Reproductive rights advocates and Pennsylvania Attorney General Josh Shapiro were quick to declare victory.

“Women need contraception for their health because contraception is medicine, pure and simple,” Shapiro said in a statement. “Congress hasn’t changed that law, and the president can’t simply ignore it with an illegal rule.”

But their win Monday is likely to be only the start of a drawn-out legal battle.

Trump administration lawyers officials are almost certain to appeal. They argued in court that the agencies involved in crafting the regulations had “reasonably exercised their rule-making authority” to protect sincere religious and moral objectors.

“No American should be forced to violate his or her own conscience in order to abide by the laws and regulations governing our health-care system," said Caitlin Oakley, a spokesperson for the U.S. Department of Health and Human Services, in a statement Monday.

Other groups vowed to join the fight, including the Little Sisters of the Poor, an order of Roman Catholic nuns. The sisters intervened in the case last year, arguing that the mandate made them complicit in breaking religious rules against birth control.

“We never wanted this fight, and we regret that after a long legal battle, it is still not over," said Sister Loraine Marie Maguire, mother provincial of the order in the United States. “We pray we can once again devote our lives to the ministry ... without being forced to violate our faith.”

If Beetlestone’s rulings withstand appellate scrutiny, the attorney generals will have to return to court to persuade her to make Monday’s temporary injunction permanent. In her decision, the judge indicated that the states' lawyers were likely to prevail. She concluded that the administration’s regulations run counter both to government rule-making procedures and the intent of Congress in crafting the Obama administration’s signature healthcare law.

“The breadth of the exemptions set out in the [regulations] is remarkable," she wrote. "The ... religious exemption allows all nonprofit and for-profit entities, whether closely held or publicly traded, to deny contraceptive coverage based on sincerely held religious beliefs.”

The birth control mandate has been one of the most fiercely litigated aspects of Obamacare.

Since it was enacted in 2010, the Affordable Care Act has generally required employers and insurers to provide preventative health services to women at no charge. Houses of worship that claimed religious objection were provided an avenue to opt out soon after the law’s passage.

In the eight years since, and after a number of court battles, the swath of employers eligible for exemptions has gradually expanded to include religiously affiliated hospitals, universities, and nonprofits, and certain privately held businesses owned by a small group of owners whose religious beliefs run counter to the law’s contraception provisions.

Some of those exempted entities are still required to provide employees with health plans that offer birth control coverage paid by the insurance provider.

But since taking office, President Donald Trump has sought to eliminate that requirement and broadly expand the number and types of entities that could claim exemptions, fulfilling a campaign pledge he made to protect employers from being “bullied by the federal government because of their religious beliefs.”

In 2017, administration officials proposed rules that would allow almost any business to claim a religious exemption and drop contraceptive coverage from employees’ health plans. They also proposed regulations that would permit all but publicly traded companies, including private colleges and universities that issue student health plans, on moral grounds.

Beetlestone blocked that effort in a case brought by Shapiro’s office, saying that the Affordable Care Act did not authorize such “sweeping exemptions.”

The administration submitted a revised set of rules in November, prompting the challenge from Shapiro and New Jersey Attorney General Gurbir S. Grewal that led to Monday’s ruling.