– “Good morning!” a loudspeaker blared recently in the working class São Paulo suburb called Jardim Monte Alegre. “We’ve got your yellow fever vaccine, and today we’re going house to house! You better wake up because mosquitoes never sleep!”

Brazil is suffering its worst outbreak of yellow fever in decades. The virus, which kills 3 to 8 percent of those who are infected, is circling the megacities of Rio de Janeiro and São Paulo, threatening to become the country’s first urban epidemic since 1942.

There have been 237 deaths since the hot season began, and the fatality rate will explode if the virus reaches the slums and the clouds of Aedes aegypti mosquitoes swarming there.

A. aegypti — known for centuries as the fearsome “yellow fever mosquito” — is also the chief spreader of Zika, dengue and chikungunya. It breeds in drinking water barrels and street garbage puddles and often bites several humans before laying eggs.

To head off that catastrophe, health officials are struggling to vaccinate 23 million people. But the effort has been slowed by what critics call government missteps and false rumors about the vaccine.

The challenges are daunting. In early 2016, the yellow fever virus broke out of its usual pattern: limited spread by forest mosquito species from monkeys to loggers, hunters, farmers and other residents of the Amazon basin. Instead, the virus began following forest corridors inhabited by monkeys toward the big coastal cities and triggering a public health emergency.

Panicky Brazilians started shooting, clubbing and poisoning monkeys. But authorities said that hurt efforts to track the virus.

Moving more than a mile a day

Last year, it did not quite reach the cities — cases faded out by July as cooler weather set in. Global health authorities sighed with relief, hoping vaccination efforts would snuff the outbreak.

But that didn’t happen, said Dr. Sylvain Aldighieri, chief of epidemic response for the Pan American Health Organization. “There was lab-confirmed transmission during the winter,” he said. “So the amount of virus around at the beginning of the summer was already huge.”

The resurgent virus is now lunging forward more than a mile a day, he said, and efforts to stop an epidemic have become a race between the virus and the vaccinators.

This year’s caseload is 26 percent higher than at this time last year, and with more hot, rainy months ahead, the figure is destined to increase.

This year yellow fever — named for its most common symptom, jaundiced eyes and skin — began killing foreign tourists. In January, just before Carnival season, another tourism lure, the U.S. Centers for Disease Control and Prevention raised its alert level, advising Americans headed for Rio, São Paulo and several other areas to be vaccinated first.

Brazil makes its own vaccine through a subsidiary of its Oswaldo Cruz Foundation. Much of this year’s chaos could have been averted if the government had acted faster, critics said. “Brazil’s public health response was very delayed,” said Dr. Karin A. Nielsen, an infectious disease expert at the University of California, Los Angeles. “Monkeys were dying in the wild two to three years ago.”

Dr. Jessé Reis Alves, a travel medicine specialist, said the vaccination campaign should have been launched “between outbreaks.” Instead, he said, “they waited for a new outbreak.”

In September, vaccinations were given to people living around forests near São Paulo where dead monkeys were found; the suburbs were targeted only in November.

Terrifying rumors spread

Initially, long lines formed at clinics, and 85,000 shots were given in one weekend. Then, on Facebook, YouTube and other social media platforms, anti-vaccine activists — who had found little footing in Brazil — began spreading terrifying rumors.

“Some people began trashing the vaccine, saying, ‘It’s going to kill you’,” said Dr. Ernesto T.A. Marques Jr., an expert in mosquito-borne diseases at the University of Pittsburgh.

The vaccine, invented in the 1930s, is effective — one dose normally provides lifetime protection. But it is not harmless. It cannot be given to newborns or anyone with a compromised immune system. It is given to people older than 60, pregnant women, or children younger than 8 months only when the risk of infection is high.

About one recipient in 100,000 suffers a dangerous reaction like jaundice, hepatitis or encephalitis, Marques said, and about 1 in 1 million dies. “If you vaccinate 30 million people, you’ll get about 30 deaths,” he said.

But if yellow fever infected 30 million people, 2 million could die.

So, with the disease moving rapidly forward, health authorities announced that they hoped to inoculate 95 percent of the population in 77 cities and towns in the virus’ path — a total of 23 million people, including 12 million in this city alone. But “they didn’t have 12 million shots to give us,” said Dr. Wilson M. Pollara, São Paulo’s health secretary. “So we’re doing it in phases — 2 million at a time.”