LOS ANGELES — Some California churches opened their doors to worshippers on Sunday, after the state revised its guidelines for houses of prayer following a U.S. Supreme Court ruling that lifted a ban on indoor services during the coronavirus pandemic.

“This morning we declare that this house will be a house of freedom,” announced Pastor Brittany Koopman at Harvest Rock Church near Los Angeles, one of the churches that sued the state over the ban. She led a socially distanced indoor crowd in prayer before Sunday’s service, which was also streamed online.

In the most significant legal victory against California’s COVID-19 health orders, the high court issued rulings late Friday in two cases where churches argued the restrictions violated their religious liberty. The justices said for now California can’t continue with a ban on indoor church services, but it can limit attendance to 25 percent of a building’s capacity and restrict singing and chanting inside.

The court was acting on emergency requests to halt the restrictions from Pasadena-based Harvest Rock and Harvest International Ministry, which has more than 160 churches across the state, along with South Bay United Pentecostal Church in Chula Vista.

Che Ahn, Harvest Rock’s senior pastor, told his congregation that the church would defy the ban on singing. California had put the rules in place because the virus is more easily transmitted indoors and singing releases tiny droplets that can carry the disease.

“Fifty percent of worship is singing. We’re gonna sing no matter what,” Ahn said at the beginning of the service Sunday. He thanked the Supreme Court and said his lawyers would continue to petition for the right to sing during indoor services. The church argued the state was unfairly restricting churches while allowing the entertainment industry to film TV singing competitions.

Worshippers without masks could be seen on the livestream raising their arms and singing out loud. It wasn’t clear how many people were inside the church, which seats hundreds.

Ahn called the state rules “draconian” and urged his congregants to sign a petition to recall Gov. Gavin Newsom.

The governor’s office on Saturday issued new guidelines that limit attendance at indoor services in areas of the state with widespread or substantial virus spread to 25% of a building’s capacity. Indoor services in areas with moderate to minimum spread are limited to 50% capacity.

“We will continue to enforce the restrictions the Supreme Court left in place and, after reviewing the decision, we will issue revised guidelines for worship services to continue to protect the lives of Californians,” the governor’s press secretary, Daniel Lopez, said in Saturday’s statement.

Before the ruling, indoor worship services were banned in purple-tiered counties — those deemed to be at widespread risk of coronavirus transmission. This tier accounts for the vast majority of the state.

Chula Vista’s South Bay United Pentecostal Church had defied state orders since last May by holding service indoors while following COVID-19 safety protocols. Pastor Art Hodges told KNSD-TV that he was thankful he could hold services on Sunday “without any pressure or threat or concern” and added that the 25% attendance limit will make him add two or three more services to accommodate church members.

“It at least allows us some wiggle room to operate,” he said.

The court’s newest justice, Amy Coney Barrett, said in her first signed opinion that it was up to churches to demonstrate that they were entitled to relief from the singing ban. Writing for herself and Justice Brett Kavanaugh, she said it wasn’t clear at this point whether the singing ban was being applied “across the board.”

Not all places of worships plan to reopen right away.

The head of Grace Cathedral in San Francisco said the Supreme Court was “not doing anyone a favor” by lifting the ban.

“We’re trying to follow the science and we’re trying to be patient,” Dean Malcolm Clemens Young told the San Francisco Chronicle.

The Archdiocese of Los Angeles, the largest of its kind in the U.S. with more than 5 million Catholics, cautiously advised “parishes who choose to return” to indoor worship to follow the singing and room-capacity rules, in addition to requiring physical distancing and face masks.

“The Archdiocese of Los Angeles is gratified by the Supreme Court’s decision to allow indoor worship services,” it said in a statement.

The court’s action follows a decision in a case from New York late last year in which the justices split 5-4 in barring the state from enforcing certain limits on attendance at churches and synagogues. Shortly after, the justices told a federal court to reexamine California’s restrictions in light of the ruling.

With few exceptions, California’s COVID-19 restrictions have been largely upheld. But a number of lawsuits, such as one seeking to allow outdoor dining, are still in the courts.

Associated Press reporter Daisy Nguyen contributed from San Francisco.