A federal judge refused Friday to block New York’s plan to temporarily limit the size of religious gatherings in COVID-19 hot spots.

U.S. District Judge Judge Kiyo Matsumoto issued the ruling Friday after an emergency hearing in a lawsuit brought by rabbis and synagogues that argued the restrictions were unconstitutional. They had sought to have enforcement delayed until at least after Jewish holy days this weekend.

The rules limit indoor prayer services to 10 people in areas where the virus is spreading fastest. In other areas with slower spread, indoor religious services are capped at 25 people.

The restrictions apply in six designated virus hot spots statewide, in parts of New York City, Rockland and Orange counties, and part of Binghamton. Nonessential businesses and schools have also been shut down in some of those areas.

Ruling from the bench, the judge said the state had an interest in protecting public safety.

Rabbis, leaders of synagogues and the national Orthodox Jewish group Agudath Israel sued, arguing that Gov. Andrew Cuomo was “singling out” Jews amid the ongoing Sukkot festival and this weekend’s Simchat Torah, which marks the annual cycle of reading the Torah.

“That targeting of a religious minority on the eve of its holidays is reason enough to reject all of defendant’s arguments and allow plaintiffs to celebrate their holidays this weekend as they have for over 2,000 years,” the groups argued in a Friday court filing.

The Roman Catholic Diocese of Brooklyn also sued in a challenge to the restrictions.

The Democratic governor's attorneys argued in court filings he didn’t single out the Orthodox Jewish community for negative treatment, but instead “clarified that this community would not receive special treatment.” And he argued that houses of worship receive more favorable treatment than non-essential businesses in the red zone.

“And a mass gathering is not less dangerous simply because it is religious in nature,” reads Cuomo’s filing. “Moreover, ‘the right to practice religion freely does not include liberty to expose the community . . . to communicable disease.’”

The legal battle over Cuomo’s COVID-19 restrictions is expected to continue for months.

He’s also fighting a June federal court ruling that said New York can’t impose stricter limits on religious gatherings than businesses. Since then, houses of worship and businesses statewide have had a 50% capacity limit, though New York City restaurants have a 25% limit.

That lawsuit was originally filed by the conservative Thomas More Society, which expanded its suit Friday to charge Cuomo’s new hot spot plan puts him in “contempt of court.”