In early autumn, it became clear that something was not right in Madagascar.
The country often sees small outbreaks of the bubonic plague, which comes from an infection spread by a flea bite. The disease is now easily treatable with antibiotics.
But this time, the number of cases was growing quickly, and the bacterial infection was spreading in a different, more serious form.
If bubonic plague is left untreated, the bacterium can travel to a person's lungs, causing pneumonic plague, which spreads and progresses more quickly. It is always fatal if left untreated and can pass from person to person.
"This epidemic is our common enemy. We must conquer it," read a press release from Malagasy government officials in mid-October, as cases rose.
According to World Health Organization estimates, in just over three months, more than 2,000 have become became ill, 171 of whom have died. By comparison, Madagascar saw about 300 cases in 2015 and 2016 each.
But this week, WHO announced that new cases and hospitalizations are declining.
Only about a dozen people are currently hospitalized for plague, and the last confirmed cases were reported in late October.
It appears that, to some extent, disaster was averted.
"Yes, I think it was," says Hilary Bower, an epidemiologist who spent a month in Madagascar as part of the UK Public Health Rapid Support Team. That was one of many organizations, including the U.S. Centers for Disease Control and Prevention and Doctors Without Borders, that worked with Madagascar's Ministry of Health to quell the outbreak.
"Pulmonary plague can spread very quickly and very easily," says Bower, who helped coordinate communication about suspect cases of pneumonic plague.
And the plague was moving through Madagascar's cities, which aren't used to handling cases. Outbreaks usually happen in rural, remote parts of the country.
Treatment centers bulked up their staff. Responders did extensive contact tracing to break the chain of person-to-person transmission. Health workers tracked down about 7,000 people who had interacted with confirmed and suspected plague patients. Ninety-five percent of them have taken preventative antibiotics. Fewer than a dozen of them came down with plague symptoms. In all, about 9,300 people received antibiotic treatment against the plague.
At 8 percent, the case fatality rate was unusually low, says Bower, "and there was no spread out of country, either."
Travelers leaving Madagascar's main airport continue to be screened for fevers. Those with plague symptoms are not allowed to travel. Surrounding countries remain alert.
"I think I'd give it an 'A,' " says Dabney P. Evans, director of the Center for Humanitarian Emergencies at Emory University, of the outbreak response.
"I think the alarm bells were rung at the right time. And the response was timely. I do think that this could have been worse," says Evans, who was not involved in the response.
But the outbreak is not completely over.
" 'Over' is a very big word," says Bower.
If one person got bubonic plague from a flea bite, didn't get treatment and developed pneumonic plague as a result, a whole new chain of transmission could start up again.
"So that awareness — that alertness — has to stay throughout the plague season," Bower says.
Despite "encouraging signs," the WHO says, it "expects more cases of plague to be reported" in the coming months.
After all, plague season in Madagascar usually doesn't end until April.
Rae Ellen Bichell is a science journalist based in Colorado. She previously covered general science and biomedical research for NPR. You can find her on Twitter @raelnb.