The governor of Michigan attended a street protest even though it appeared to violate her own order demanding social distancing. So did Pennsylvania’s governor. Washington’s mayor for weeks had a Twitter handle that told people to “stay home” — while sharing video of protesters massing near the White House on a street emblazoned with a mural she commissioned.

Months after the coronavirus forced Americans into their homes, protests over the killing of George Floyd in Minneapolis police custody drove hundreds of thousands of people back to the streets. Demonstrators, elected officials and public health experts said the risk of being exposed to the virus is acceptable because the protests speak to the enduring effects of racism that lie at the root of Floyd’s death and the disproportionate toll the pandemic has exacted on African Americans.

More than 1,000 public health specialists signed a letter supporting the massive outpouring of grief and anger.

Ranu S. Dhillon, an infectious-disease expert at Harvard Medical School, said he views the protests as risky but necessary — just like working in a nursing home or grocery store.

“Protesting against systemic injustice that is contributing directly to this pandemic is essential,” Dhillon said. “The right to live, the right to breathe, the right to walk down the street without police coming at you for no reason . . . that’s different than me wanting to go to my place of worship on the weekend, me wanting to take my kid on a roller coaster, me wanting to go to brunch with my friends.”

But groups that were criticized for ignoring stay-at-home orders earlier in the pandemic said political leaders and public health experts are muddling directives to remain at home and, when in public, to carve out six feet between others — and worse, tailoring their message to fit their own political perspectives.

Revelers who attended a Missouri pool party were mocked across the country, and conservatives who protested coronavirus mitigation orders at state capitols came under fire.

New York Mayor Bill de Blasio (D) in April ordered the dispersal of Orthodox Jewish mourners flooding Brooklyn streets during a funeral for a rabbi who succumbed to the coronavirus.

During the recent police brutality protests, de Blasio was more nuanced, saying at a news conference that “this is just a horribly complex situation.” A leader in New York’s ultra-Orthodox Jewish community told Haaretz that “the double standard is blatant and shocking.”

De Blasio spokeswoman Freddi Goldstein said in an email that the funeral occurred “at the peak of the pandemic ravaging our city. . . . It’s a different time and the risk is not the same, but we still must prioritize safety. Everyone must be wearing masks and we still encourage all protesters to . . . make their voices heard from home.”

D.C. Mayor Muriel E. Bowser (D) said last week she was “very concerned” about a possible spike in cases of covid-19, the disease caused by the novel coronavirus, stemming from the protests: “This is a mass gathering that we don’t want for the prevention of covid.” But she also joined those protests and at one point took off her mask. On Wednesday, she said she had been tested for the virus and told reporters, “People have a right to exercise their First Amendment rights, especially in the District of Columbia.”

In Pennsylvania, Gov. Tom Wolf (D) made a trip to Philadelphia after five days of escalating protests and marched with protesters in Harrisburg “to show solidarity and urge de-escalation so we can address the issues of structural inequality without violence,” Wolf spokeswoman Lyndsay Kensinger said. “This was not something the governor would prefer or recommend, but he thought it was necessary to help the commonwealth. Throughout the pandemic, the governor has made limited allowances for constitutionally protected speech including protests and religious services.”

The office of Michigan Gov. Gretchen Whitmer (D) did not respond to a request for comment.

Critics dismiss those allowances as an untenable inconsistency. In North Carolina, the owner of a speedway shut down by the state as an “imminent hazard” claimed that car racing is a “peaceful protest of injustice and inequality.” Rep. Lynn Afendoulis (R-Mich.), who had participated in protests against the state’s pandemic orders, tweeted that “social distancing is critical to stop the spread of COVID-19 — unless you have a great photo op . . . I’ll take hypocrisy for $1000.”

President Trump, who has questioned the value of social distancing, amplified many such biting comments on Twitter.

Health authorities are on alert for the emergence of coronavirus cases among protesters and have urged them to isolate and get tested.

The public health department in Columbus, Ohio, announced that one protester there tested positive. In Athens, Ga., County Commissioner Mariah Parker tested positive after leading a march last weekend. So did several members of the National Guard posted in the District.

Amesh Adalja, an infectious-disease expert at the Johns Hopkins University Center for Health Security, argued that no group should be singled out for public shaming, no matter their motives.

“This outbreak has been very politicized from the beginning,” he said. “That kind of shaming of people for doing certain things doesn’t help at all. It puts people into two different camps much more quickly.”

Leaders, he said, should focus on communicating the risks and monitoring hospital capacity. “People are going to make decisions based on their values,” he said.

But many who supported the protests following Floyd’s death said it is valid to draw distinctions among the motivations of people who abandon public health directives. The letter signed by public health experts and written by infectious-disease experts at the University of Washington said that “as public health advocates, we do not condemn these gatherings as risky for COVID-19 transmission. We support them as vital to the national public health. . . . This should not be confused with a permissive stance on all gatherings, particularly protests against stay-home orders.”

Car caravans offered people a way to protest from a distance. Protesters at the street marches handed out free face masks and hand sanitizer. But as the movement grew, a six-foot barrier between participants became impossible to maintain. Masks came off so that demonstrators could shout into bullhorns or wash off chemical agents fired by police.

Protesters and their allies said law enforcement exacerbated the situation by corralling protesters onto narrow streets and hitting them with chemical agents.

“Any governor could say right now, ‘I want to ban tear gas, I want to ban pepper spray, I want to ban rubber bullets,’ ” said Dhillon, the Harvard expert.

Rahul Dubey, who let dozens of protesters into his D.C. home last week, said the group was attempting to maintain social distance until they were chased down his block by police in riot gear firing chemical weapons. They ended up staying in his house overnight — the kind of crowded indoor setting experts say poses the greatest risk of transmission.

No one from the city reached out about potential testing or contact tracing, he said.

“If public health had come to the door, I would have told every single one of the people who were in this house to go out to them with me,” he said.

As protests across the country became larger and the police presence smaller, other risks emerged from the peaceful scenes that developed — protesters were jammed closer together, and more masks came off for impromptu concerts and Italian ices.

The New York City Department of Health and Mental Hygiene issued advice on protesting safely that includes, “Do not yell; use signs and noise makers instead” and “Keep 6 feet from other groups.” Seattle’s public health department cautioned that prevention efforts are not “all-or-
nothing . . . take precautions, understand the risks.”

Tom Frieden, director of the Centers for Disease Control and Prevention during the Obama administration, said those who accused him of hypocrisy for supporting the protesters did not appreciate that he has consistently said outdoor activities are low-risk.

“I didn’t criticize outdoor protests of the lockdowns, because they were outdoors,” he said. “Outdoor activities are generally safe.”

But “as a physician, seeing those images [of Floyd’s death] are really too horrific for words,” he said. African Americans are more likely to contract the coronavirus and die of covid-19, he noted. Black people have lower life expectancy than whites and higher rates of disease; doctors systematically underestimate pain in black patients and give them generally inferior care. Research has found racism itself has pernicious health effects.

But, Frieden said, people protesting shutdown orders also had legitimate complaints. Some areas shut down too early in Frieden’s view, others too late.

“The broader issue is really an issue of trust in government,” Frieden said. “If that trust is undermined by violent policing, or it’s undermined by ham-handed public health actions that don’t respect communities, that’s going to have a negative impact on our ability to fight disease.”