For nearly two months, a Northeast Philadelphia religious school flouted the city’s mandatory masking order.

And though staff and children are now wearing masks after the city asked a judge for an emergency injunction, leaders of the church that runs Calvary Christian Academy have vowed to fight for the right to keep masks optional.

It’s another salvo in an increasingly bitter political battle over mask-wearing in Pennsylvania and schools across the country.

Since the beginning of the school year, CCA, a prekindergarten-through-12th-grade school on Philmont Avenue in the city’s Somerton section, “did not require masking, did not enable social distancing among the students, and did not require members of the school exposed to COVID-19 to quarantine,” according to court documents.

Though both Philadelphia and Pennsylvania issued mandatory masking orders this summer amid the continuing pandemic and rising case counts, CCA told parents in a Sept. 6 letter that despite government orders, “we will keep the current COVID protocol in place, which states that masks are optional.”

» READ MORE: How the mask fight continues to play out in Pa.

Some parents complained about CCA’s mask-optional policy at the beginning of the school year. Separately, the school came to the attention of health department workers monitoring COVID-19 containment through a number of cases reported at the school — 23 between Sept. 7 and Oct. 5.

CCA staff told a city worker in late September they believed the school did not need to observe health department regulations because “CCA was a private religious school,” court filings show. The school also failed to submit to the city information about close contacts of CCA staff and students who tested positive for COVID-19.

In an Oct. 6 inspection, an environmental health worker observed unmasked CCA staff and students. Officials demanded compliance, and the school and a lawyer with the Pacific Justice Institute — a conservative legal defense organization representing CCA — initially said the school would adhere to the rule.

But on a second visit, CCA staff and the Rev. Jerry Paradise, assistant pastor of Calvary Chapel of Philadelphia, declined further inspection, citing religious freedom.

Paradise told city officials some CCA parents had submitted forms requesting their children be exempt from the mask policy for medical or religious reasons, and directed all further contact be made through the school’s lawyer.

Citing the pandemic and a duty to protect public health, the city asked a judge to intervene on Thursday, and on Friday, Common Pleas Court Judge Joshua Roberts signed an order for staff and students to follow the city’s masking rules.

Statewide, several lawsuits have raised the issue of masking orders. Pennsylvania Commonwealth Court judges are considering two such suits, including one brought by Senate President Pro Tempore Jake Corman and other parents, challenging the legality of Pennsylvania’s mandate.

Eric Winter, the lawyer representing CCA, said the school agreed to comply with the health department’s mask mandate — for now.

“We are going to be objecting to the legality of this,” Winter said.

In the order issued Friday, the school said it would require masks and adhere to the city’s COVID-19 reporting orders, as well as a policy requiring those exposed to COVID-19 to forgo in-person school attendance for a time, or a “test to stay” policy, with close contacts required to submit negative COVID-19 tests over several days in lieu of quarantining.

The Rev. Joe Focht, Calvary Chapel’s senior pastor, told families about the legal action at church and in a letter sent Sunday but made it clear the school would continue to battle the city.

“After consulting with four different attorneys, their counsel was to comply with the order temporarily until we prepare our case for our day in court,” Focht wrote in the letter, which was obtained by The Inquirer. “This means that every student will need to wear a mask when attending CCA for now. Medical exemptions will be accepted for not wearing a mask and any other extenuating circumstances that are applicable. More information will be forthcoming this week. Thank you for your anticipated cooperation.”

One CCA parent alarmed by the school’s initial refusal to comply with the mask mandate said the decision placed children at risk and “was also a disavowal of the long-held Christian teaching that Christians and the church are to obey the government unless what the government is requiring is in conflict with what God commands.” The parent, who asked not to be identified for fear of reprisal, added, “Being that there is nothing in the Bible that remotely addresses something such as our current situation of wearing masks, there is then no direct conflict with God when the government mandates the wearing of them.”

While some parents have complained about the mask-optional policy, both to the city and to school leadership, “most are in favor of not complying,” the parent said. “Some are even gung-ho about it.”