A U.S. appeals court agreed Tuesday with two Nevada churches that have argued for months that the state’s COVID-19 restrictions are unconstitutional because they place harsher attendance limits on religious gatherings than casinos and other secular businesses.

The 9th U.S. Circuit Court of Appeals reversed earlier federal court rulings that upheld Nevada’s hard cap on the size of indoor worship services. It instructed the district judges to preliminarily enjoin Nevada from imposing attendance limits for churches stricter than those for other gatherings or businesses.

“The restrictions at issue here, by effectively barring many from attending religious services, strike at the very heart of the First Amendment’s guarantee of religious liberty,” a three-member appellate panel said in an 11-page ruling reversing the lower court’s refusal to grant a preliminary injunction sought by Calvary Chapel Dayton Valley in rural Lyon County east of Reno.

The limits treat “numerous secular activities and entities significantly better than religious worship services,” it said in a four-page opinion reversing a similar earlier ruling involving Calvary Chapel Lone Mountain in Las Vegas.

Attendance at casinos, restaurants, bars and numerous other businesses currently are limited to 25 percent of capacity, but churches are subject to a hard cap of 50 people or 25 percent of capacity, whichever is less.

Others subject to the 25 percent capacity limit but no hard cap include bowling alleys, arcades, amusement parks, breweries, wineries, museums, zoos, gyms and fitness facilities.

The new rulings direct the district court judges to bar the state at least temporarily from imposing attendance limitations on in-person services in houses of worship that are less favorable than 25 percent of the fire code capacity.

David Cortman, a lawyer for the Alliance Defending Freedom representing the Dayton Valley church that first filed suit this spring, said the ruling marked a “significant win.”

“There is no constitutional right to gamble, but there is one that protects attending worship services,” he said in a statement. “The government has a duty to respect the First Amendment, so it can’t single out churches for harsher treatment than secular activities.”

Since Nov. 24, Nevada has enforced tightened restrictions meant to rein in a COVID-19 surge that has broken records in daily cases and deaths, putting more state residents per capita in the hospital for COVID-19 than any other state.

Gov. Steve Sisolak expressed disappointment at the rulings, but said the state will comply and urged faith leaders to voluntarily abide by public health measures “especially when COVID-19 infection rates, hospitalizations, and deaths are at an all-time high in Nevada.”

“These measures include wearing face coverings, maintaining social distancing, limiting the size of gatherings and the duration of services, and seeking virtual service options,” the Democratic governor said in a statement.

Attorney General Aaron Ford hasn’t decided whether to try to challenge the ruling, his spokeswoman Monica Moazez said.

The 9th Circuit judges in San Francisco said Tuesday they agreed with earlier U.S. Supreme Court rulings that said judges are not public health experts and should respect the judgment of those with special expertise in this area.

“But even in a pandemic, the Constitution cannot be put away and forgotten,” Judge Milan Smith wrote on behalf of the panel.

The appellate court cited a Supreme Court ruling Nov. 25 that barred New York from enforcing certain limits on attendance at churches and synagogues more stringent than others in areas designated as hard hit by the virus.

That 5-4 ruling in favor of the Catholic Diocese of Brooklyn “arguably represented a seismic shift in Free Exercise law, and compels the result in this case,” the appellate panel said Tuesday.

In a 5-4 decision in July before conservative Justice Amy Coney Barrett filled a vacancy created by the death of liberal Justice Ruth Bader Ginsburg, the Supreme Court refused the Dayton Valley church’s request for a temporary order blocking enforcement of Nevada’s religious gathering cap while its appeal was pending before the 9th Circuit. The church has since asked the high court to reconsider that ruling.

The churches sued in May over Sisolak’s original directive capping all indoor religious gatherings at a maximum of 50 people regardless of the church’s capacity.

On Sept. 30, he established a limit of 250 or 50 percent of capacity, whichever is less. And on Oct. 24, returned to a cap of 50 people or 25 percent of capacity, whichever is less.