Sacramento, Calif. • With their most vulnerable members at home, their community in the streets, and their nation wracked by a pandemic, riots and political polarization, Pastor Samuel Rodriguez’s congregation went to church in Sacramento on Sunday, at times violating state health rules in the interest of unity.

“Outside the confines of these walls we hear the sound of a very broken world,” preached Rodriguez, an evangelical minister. “Outside these corridors of worship we hear the sound of desperation. Throughout America today we hear the sounds of a nation torn apart by the devil of racism.”

In an auditorium in a part of town that had erupted over the weekend in response to the death of a black man in police custody in Minnesota, roughly 100 black, white and Hispanic members of the New Season church raised sanitized hands toward heaven. “Yes!” they shouted. “Amen!”

As nationwide protests against the police killing of George Floyd entered their sixth day, the terror of death by coronavirus intersected Sunday with rage over a different disease — police killings of African American people — settling, for many, the question over when to emerge from America’s long national quarantine.

In communities across the country, many congregations that had sequestered for months in fear of catching or spreading the lethal coronavirus ventured forth at a social distance in search of comfort.

More than half of the states have continued to allow religious gatherings, but many churches, synagogues and mosques, for safety’s sake, have chosen for months to make do with Zoom sermons and livestreams. Many stuck to remote services Sunday, but a significant number returned to public worship driven by a combination of pain, prayer and political expression.

In Pennsylvania, the Archdiocese of Philadelphia resumed public Mass, but with churches restricted to half-occupancy, and every other pew empty. The Church of Jesus Christ of Latter-day Saints resumed some in-person services in Alaska, Georgia, Louisiana, Illinois, Utah and a number of other locations, but chose not to reopen temples in Nevada, Hawaii, Washington and other states.

In California, at least a dozen evangelical churches made a coordinated return timed to Pentecost, a day of Christian jubilation that many regard as the church’s birthday. Some in that group were also seeking to pressure the state’s Democratic governor, Gavin Newsom, into dropping a 100-person cap on church attendance and other rules enacted to curb the pandemic as the state’s coronavirus case count soared past 100,000, with 4,000 deaths. Several significant outbreaks started in churches.

The state’s right to restrict church attendance during the crisis was upheld by the U.S. Supreme Court late Friday.

“Obviously we’re disappointed with the court’s ruling,” said Pastor Jim Domen, the founder of Church United, a group that had mobilized more than 1,500 pastors against California’s emergency restrictions. “But we report to a higher authority.”

In Fresno, California, 350 congregants registered to attend a socially distanced service at Cornerstone Church, whose pastor earlier in the week had compared Mr. Newsom to Soviet leaders who had propped up the Berlin Wall.

But at the Water of Life Community Church in Fontana, where some 320 people had reserved tickets for a return on Sunday, Pastor Dan Carroll said on a livestream that the church was reconsidering its plan, and had decided “to try to comply and pray that he changes his mind in the next two weeks,” referring to Mr. Newsom. The sanctuary did open, but only about 100 people per service were allowed to enter.

In Sacramento, Rodriguez and his members sang mostly without masks, in violation of state directives, but turned away some worshippers, trying to keep the crowd under 100. His point, he said, was not to criticize the governor, but to stand with his church.

Robert H. Tyler, the lawyer representing the churches and pastors who signed the petition, cited growing rates of anxiety and depression, as well as the national unrest, as a justification for not complying with the Supreme Court decision.

“Let’s give an outlet for people to meet in churches as an alternative to shutting down freeways and burning down buildings,” the statement said.

In Sacramento, still raw from the 2018 police killing of Stephon Clark, an unarmed young black man, the return to worship was set against multiple social flashpoints.

Rodriguez said New Season had been planning to return from quarantine Sunday for several weeks. His motives were not as political as those of some ministers, he said — he delivered one of the prayers at President Donald Trump’s inauguration, but likes to say that his parishioners “worship the lamb, not the elephant or the donkey.”

But he also disapproved of Newsom’s church guidelines, saying the cap on attendance was punitive for a 1,000-seat church like his. Also punitive, he said, was the state’s ban on church singing, a precaution against the airborne spread of the virus.

(Max Whittaker | The New York Times) Worshippers during service at the New Season church in Sacramento, Calif., May 31, 2020. More than half of the states have continued to allow religious gatherings, but many churches, synagogues and mosques, for safetyÕs sake, have chosen for months to make do with Zoom sermons and livestreams, but many stuck to remote services on Sunday, but a significant number returned to public worship driven by a combination of pain, prayer and political expression.

Then came the national fury at Floyd’s death.

On the day before New Season’s service, nearly 1,000 demonstrators wielding Black Lives Matter signs converged on California’s state Capitol. As night fell, crowds swarmed the freeways and the Sacramento Kings’ glistening sports arena, defacing a landmark sculpture by artist Jeff Koons and looting nearby department stores.

The pain was especially sharp at New Season, where the congregation is 40% black, 40% white and 20% Hispanic. Patricia Littlejohn, a church volunteer, said she had sought to tune out the violence, but that it had evoked painful memories of Clark’s shooting. Coming on top of the pandemic, which cost her job at a health club, she said the unrest left her feeling isolated.

Gesturing to her fellow congregants, who were trying not to hug even as other volunteers entreated them to keep 7 feet of space between them, Littlejohn smiled. “This,” she said, “means everything.”

In the front row, Mercedes Ray, a member of the church board, said the explosion of violence compelled churches to act. “What has happened out there is that people feel backed into a corner. They feel they’re not being heard and that nothing has been done.”

That concern echoed with particular force among African American churchgoers, at the epicenter both of the fury over Floyd’s death and of the toll of the coronavirus. Out of caution, many African American churches held services with pastors preaching to empty sanctuaries and virtual congregations — even on a day when they would have wanted to be together most.

“I think the church has to help make sure it is a wake-up call,” said the Rev. Dr. W. Franklyn Richardson, the senior pastor at Grace Baptist Church in Mount Vernon, New York, who kept his parish online Sunday.

“The church has had to be a safety net for a society that has ignored the community,” he said. “It’s like you pull back the covers and saw all the years of inequity and, to some degree, racist disregard for African Americans and people of color.”

Among California’s evangelical establishment, not everyone was ready to risk returning.

The Rev. Rick Warren, whose Orange County-based Saddleback Church serves some 30,000 members at 20 locations, told congregants in an emailed video message this week that “Saddleback is going to be patient and wait for better conditions before resuming our large public gatherings.”

On this Sunday, however, even the online prayers resonated.

“What a shame it would be,” the Rev. Dr. William J. Barber II of the North Carolina-based civil rights group Repairers of the Breach said in his streamed sermon, “if this nation could watch a policeman murder another human being and then pose like a hunter with his prey while his colleagues looked on — and there not be protests, there not be anger, there not be tears, there not be a diversity of people willing to say this is not right.”

“Hear me, America,” Barber added. “The lethal violence of these racist officers and others is only one manifestation of the systemic racism that is choking the life out of the American democracy.”

For many, what Americans do next matters much more than their ability to sit together in person in full church pews.

“I’ve talked with lots of black friends and pastors who are altering between rage and tears all the time,” said the Rev. Dr. Terri Hord Owens, who leads the Christian Church, also known as the Disciples of Christ, which has some 3,000 congregations in the U.S.

“The exhaustion that you feel as a black person in the United States is overwhelming and continues,” she said. “No matter what we say, no matter what we even do, this stuff keeps happening.”

Owens is the first African American (and second woman) to lead a denomination whose membership is about 80% white. She said her mission now, as black churches mobilize, was to make sure that white churches joined them.

Her church, like other mainline Protestant denominations, has taken progressive stances on social justice causes. But she said their efforts had to venture beyond academic discussions about racial inequality and institutional change.

“The white church in America is going to have to get serious,” Owens said. “We’re good at gathering and mourning, but we’ve got to turn to action now, and black folks can’t do it alone.”