Booster shots of the Pfizer-BioNTech and Moderna vaccines lose substantial effectiveness after about four months — but still provided significant protection in keeping people out of the hospital during the omicron surge, according to a study published Friday by the Centers for Disease Control and Prevention.

Researchers found the booster shots remained highly effective against moderate and severe covid-19 for about two months after a third dose. But their effectiveness declined substantially after four months, suggesting the need for additional boosters, the study said.

The vaccine was 91 percent effective in preventing a vaccinated person from being hospitalized during the two months after a booster shot, the study found. But after four months, protection fell to 78 percent.

Protection faded more in preventing trips to urgent care and emergency departments, falling from 87 percent in the first two months to 66 percent after four months. After more than five months, vaccine effectiveness fell to roughly 31 percent, but researchers noted that estimate was “imprecise because few data were available” for that group of people.

Protection from the two-dose vaccine regimen has declined since omicron became dominant, but a third dose revs the immune system back up to robust levels to prevent moderately severe and severe disease, an earlier CDC study found.

But how long that third shot’s protection lasts is a critical question facing public health officials because many people received their third dose months ago. Waning immunity after a third shot of mRNA vaccine during omicron has been observed in Israel and in preliminary reports from CDC, the study said. But Friday’s report represents the first real-world data in the United States of the durability of that protection during delta and omicron.

During a White House covid-19 briefing Wednesday, Anthony S. Fauci, President Biden’s chief medical adviser on the pandemic response, said officials will base booster decisions on real-world “efficacy in preventing, for example, hospital visits, as well as hospitalizations.”

“I think you should be appreciative of the fact that when you’re talking about any decisions that will be made — and I’m not anticipating any of that now — but that has to be put into the context of whom you’re talking about,” he said.

“There may be the need for yet again another boost — in this case, a fourth-dose boost for an individual receiving the mRNA — that could be based on age, as well as underlying conditions,” Fauci said.

Waning protection after a third vaccine dose “reinforces the importance of further consideration of additional doses to sustain or improve protection against COVID-19-associated” visits to emergency departments and urgent care and hospitalizations, the study said.

In a statement, CDC said boosters are “safe and effective” and the study shows that a third dose of mRNA vaccine “continues to offer high levels of protection against severe disease, even months after administration, underscoring the importance of staying up to date when eligible after receiving a primary series.”

Coronavirus cases spiked globally in the first weeks of 2022, despite record-high vaccination rates. Here’s how the omicron variant took off. (Jackie Lay, John Farrell/The Washington Post)

Since September, federal health officials have urged people to get the third shots. CDC recommends booster shots for everyone 12 years and older, five months after getting two doses of the mRNA vaccines made by Pfizer-BioNTech and Moderna, or two months after a single dose of the Johnson & Johnson vaccine.

About 91 million Americans have received boosters. Nearly 8 million had gotten their boosters at least four months ago, according to CDC data. Most of the people eligible for boosters have not received them, according to CDC calculations. That includes more than one-third of the most vulnerable people age 65 and older who have received a full dose of regular vaccines but have not received a booster.

Vermont, Minnesota, Wisconsin and Maine have vaccinated the largest share of people who had already been vaccinated. The lowest rates for booster doses are in Alabama, Georgia, Texas, Mississippi and the District.

The CDC study looked at hospitalizations and emergency room and urgent care center visits in 10 states, from August to Jan. 22, 2022, covering periods when delta and omicron were dominant. In the study, about 10 percent of people were boosted and over 50 percent of people hospitalized were over 65 years old.

But the report did not evaluate the variations in waning immunity by age, underlying health conditions, or a person’s immunocompromised status.

Experts said the findings were not unexpected since studies have already shown vaccine effectiveness declines after two doses.

While the data suggest that additional boosters may be needed, the findings underscore the added value of a booster compared with two doses. They also show that vaccines developed against the ancestral virus strains are still providing protection against new variants, said Albert Ko, an infectious-diseases physician and epidemiologist at Yale’s School of Public Health.

“Each time we are boosting with these vaccines, our immune responses may be getting broader and not narrower in protecting against the scope of variants we are encountering,” he said. Protection against the array of variants two years into the pandemic is “pretty amazing, whether you’re getting the primary series or that boost.”

Even after four months, the 78 percent effectiveness in preventing hospitalizations is “a silver lining,” Ko said. “It’s another argument that getting boosted now will prepare you better when you need to get boosted again in the face of new variants.”

While a booster’s protection declines more over time in preventing visits to urgent care or emergency departments, Jeanne Marrazzo, an infectious-diseases physician at the University of Alabama at Birmingham, also noted the robust protection against hospitalization, even after four months.

The study does not provide the level of detail to know whether people were going to urgent care clinics for “a little sniffle,” she said. “That’s not the same thing as coming into the ICU and needing to be intubated.”

“I honestly think we were unrealistic early on in conveying the idea that vaccine efficacy should be primarily characterized by protecting from infection,” Marrazzo wrote in an email. “As variants evolve and get better at infecting us, what we’ll need to focus on is mitigating the consequences.”

In a second study released Friday, CDC reviewed data from two of its vaccine safety monitoring systems. It found that those 18 and older who received the same mRNA vaccine for all their shots had fewer side effects after the booster than after their second dose.

In one safety database known as VAERS (Vaccine Adverse Event Reporting System), which contains information on unverified reports that can be submitted by anyone, 92 percent of the reports were not considered serious, with headache, fever and muscle pain among the most commonly reported reactions. In a second safety system known as v-safe, which allows individuals to get personalized and confidential health check-ins via text messages and Web surveys, people rarely received medical care after booster, the study found.

Dan Keating contributed to this report.