A federal judge in Philadelphia on Friday temporarily blocked Trump administration rules that would limit women's access to free birth control under the Affordable Care Act.

U.S. District Judge Wendy Beetlestone sided with Pennsylvania Attorney General Josh Shapiro, who filed the legal challenge, in granting a preliminary injunction to halt the increasing number of employers allowed to forgo providing free contraception for female employees by asserting religious or moral objections.

"The potential harm faced by Pennsylvania women and [women] across the nation is enormous and irreversible," Beetlestone wrote in her 44-page opinion.

In October, Shapiro sued to block the Trump administration's rollback of the birth control coverage mandate under the Affordable Care Act, also known as Obamacare.

The law required most employers to cover contraceptives at no additional cost to employees. As a result of litigation, exemptions were provided to religious organizations.

The Trump administration changes expanded the number of employers eligible for the exemptions.

Lauren Ehrsam, a spokeswoman with the U.S. Department of Justice, which argued in court for the administration,  said Friday night, "We disagree with the court's ruling and are evaluating next steps. This administration is committed to defending the religious liberty of all Americans, and we look forward to doing so in court."

A lawyer with the Becket Fund for Religious Liberty, which represents the Little Sisters of the Poor, a group of Catholic nuns active in the fight against the contraceptive mandate, called Beetlestone's decision wrong.

"We are confident that the appeals court or the Supreme Court will overturn this ruling and ensure that the government can do the right thing and continue to protect religious groups like the Little Sisters of the Poor," said Lori Windham, senior counsel.

In a statement, Gov. Wolf called the ruling "a victory for all women in Pennsylvania and the country, and especially low-income women, who may not have been able to afford this important medication under the Trump administration's draconian decision."

Shapiro said the judge's decision was an important first step in the legal fight against the changes.

"Congress hasn't changed the law, so the president can't simply ignore the law with these illegal rules," Shapiro said at a news conference in Harrisburg after the court ruling was filed.

Dayle Steinberg, president and CEO of Planned Parenthood Southeastern Pennsylvania, cheered the ruling.

"After the president tried to defund Planned Parenthood and deny reproductive care to women through his failed Obamacare repeal, he tried a backdoor approach in pursuing his war on women," Steinberg said in a statement. "It didn't work then, and it's not working now."

Liz Navratil of the Harrisburg bureau contributed to this article.