For a few glorious months, it looked as if vaccination was curbing the COVID-19 pandemic in the United States, enabling vaccinated people to shed their masks, at least in regions with high immunization rates.

But on Tuesday, the Centers for Disease Control and Prevention backpedaled on the don’t-need-a-mask advice it issued two months ago, citing the sudden predominance of the delta strain, an extremely transmissible, more harmful variant of the coronavirus. The agency now recommends universal masking inside public spaces in communities with higher transmission rates. So far, that doesn’t include most of the Philadelphia region, except for Burlington County in New Jersey.

Delta has hit hard in places with little vaccination. Worse, there is evidence that even vaccinated people can, in rare cases, contract and spread it.

CDC Director Rochelle Walensky stressed that vaccination remains critical to ending the pandemic. Indeed, President Joe Biden said Tuesday that the federal government was considering making vaccines mandatory for its workforce. The Department of Veterans Affairs on Monday announced a mandate for its health-care workers.

But because the delta strain has evolved mutations that make the vaccines somewhat less protective -- exactly how much is not yet known -- the CDC now recommends that vaccinated people in hard-hit areas wear masks in public indoor spaces. Vaccinated individuals should also wear masks in public if they have young children or immune-compromised people at home.

As for the reopening of schools, the CDC urged universal masking, regardless of vaccination status -- the same stance as the American Academy of Pediatrics.

“This is not a decision we made lightly,” said Walensky. “I know people are tired and frustrated. ... This new advice weighs heavily on me.”

Masking in schools has been a source of contention in districts around the Philadelphia region. Many area districts dropped their mask requirements when Pennsylvania’s mandate expired in late June, and the idea of reinstituting the precaution this fall has spurred heated debate.

While the Philadelphia School District plans to require everyone in schools to mask up, a number of suburban districts have made masks optional -- and the CDC’s update won’t necessarily change those plans.

“We’re still in a pretty good position with the strategies we have in place to manage cases as they occur,” said Lee Ann Wentzel, superintendent of the Ridley School District in Delaware County, which has been recommending that unvaccinated children and staff wear masks in schools but isn’t requiring it.

Those opposed to masking mandates have noted that children are at much lower risk of severe illness than adults. Still, “to say children are not affected is simply not true,” said Mariam Mahmud, a pediatrician and candidate for the Central Bucks School Board who is in favor of following CDC guidance.

Pennsylvania is not considering instituting another statewide mask mandate in response to the CDC update, state health officials said Tuesday.

But they said people in counties with surging cases should follow CDC guidance. Philadelphia and most of its suburbs are experiencing moderate levels of virus transmission. However, the city last week asked vaccinated residents to begin masking indoors again.

Based on transmission levels in Pennsylvania as of Tuesday, the CDC’s recommendation applied to seven counties: Crawford, Lawrence, Cameron, Wyoming, Adams, Monroe, and Northampton, which is just north of Bucks County. It also applied to eight New Jersey counties: Burlington, Atlantic, Monmouth, Middlesex, Union, Essex, Bergen, and Ocean.

“We cannot stress enough the importance of eligible Pennsylvanians getting vaccinated to stop the spread of COVID-19,” said Pennsylvania Health Department spokesperson Maggi Barton.

CDC analyses of patients’ respiratory samples in states with surging case loads have found the delta variant in 80% of samples, Walensky said.

She added that vaccinated patients who get infected with delta generally do not get sick enough to need hospital care. But CDC research shows their viral loads -- meaning the concentration of virus particles in their bodies -- are just as high as in unvaccinated patients, suggesting both groups can readily spread the virus.

That complements a study reported by Chinese scientists. They found that delta produces about 1,200 times the viral load of the original coronavirus strain. Even scarier, delta was first detectable in people four days after exposure to the virus, compared with an average of six days for people with the original strain, suggesting that delta makes copies of itself within cells much faster.

Whether delta is deadlier for unvaccinated people is still unclear, but in general, viral load is linked to disease severity and death.

“People don’t realize how bad delta is,” James Lawler, an infectious-disease doctor at the University of Nebraska, told the Washington Post. “We are looking at transmission dynamics at least as bad as in the fall — with no mitigation measures in place in most states with low [vaccination] rates.”

Staff writers Maddie Hanna and Erin McCarthy contributed to this article.