A split U.S. Supreme Court Friday night upheld California's limits on attendance at houses of worship during the pandemic, rejecting a First Amendment challenge by a San Diego County church.

Chief Justice John Roberts, joining the more liberal bloc of the high court, wrote that the temporary attendance caps "appear consistent" with the free exercise clause of the First Amendment.

"Similar or more severe restrictions apply to comparable secular gatherings, including lectures, concerts, movie showings, spectator sports, and theatrical performances, where large groups of people gather in close proximity for extended periods of time." Roberts wrote.

State officials have broad latitude to protect the public's health and safety, and that authority generally "should not be subjected to second-guessing" by unelected federal judges, Roberts continued.

"That is especially true where, as here, a party seeks emergency relief in an interlocutory posture, while local officials are actively shaping their response to changing facts on the ground," Roberts wrote.

The South Bay United Pentecostal Church in Chula Vista had asked the court for injunctive relief allowing it to hold unfettered services on May 31, Pentecost Sunday. A May 26 order by San Diego County health officials, based on guidance issued by Gov. Gavin Newsom's administration, limits attendance at places of worship to 25% of a building's capacity, or 100 attendees, whichever is lower, during the COVID-19 outbreak.

The church, represented by Charles LiMandri of the Rancho Sante Fe firm LiMandri & Jonna, argued that California placed no such capacity restrictions on manufacturing or warehouse facilities. LiMandri is working on the case with the Thomas More Society and the Dhillon Law Group.

"California's latest safety guidelines discriminate against places of worship and in favor of comparable secular businesses," Associate Justice Brett Kavanaugh wrote in a dissent that was joined by Justices Clarence Thomas and Neil Gorsuch.

The state could have told houses of worship to abide by social distancing and other health requirements and left congregations to decide how that should be done, Kavanaugh wrote.

"But absent a compelling justification (which the State has not offered), the State may not take a looser approach with, say, supermarkets, restaurants, factories, and offices while imposing stricter requirements on places of worship," Kavanaugh wrote.

The state, represented by Attorney General Xavier Becerra's office, had argued that warehouses and office buildings typically don't house people singing or reading aloud in potentially close contact with one another for extended periods of time.