Of all the public health stories I’ve covered in the past few years, the plague epidemic that’s been brewing in Madagascar since the summer frightened me most.

While the island nation battles plague outbreaks every year, this one, which began about four months ago, was much larger than usual. It spread to 2,300 people in the capital and other cities, killing 207. Making things worse, the type of plague that spread is pneumonic, a rare and more dangerous form of the disease that attacks the lungs and passes from person to person through droplets from coughing. It’s much more contagious than other forms of plague.

Untreated pneumonic plague is always deadly; patients die typically within 24 hours of disease onset — unless they’re lucky enough to get antibiotics.

But it now seems like Madagascar is turning a corner, according to the World Health Organization. “Due to concerted national and international response the current and unprecedented outbreak of plague in Madagascar,” the agency reported this week, “has been contained.”

A potential global health disaster appears to be averted, at least for now, thanks to basic public health measures — and a few lessons learned from the tragic 2013–’16 Ebola epidemic.

How the WHO stopped a plague catastrophe

The WHO was widely criticized for responding to the recent Ebola epidemic in West Africa too slowly. But since that epidemic, the agency took the criticism to heart and changed course, rapidly helping Madagascar control what could have been a very deadly outbreak.

As soon as it became clear Madagascar’s plague season was unusually forceful this year, the WHO delivered 1.2 million doses of free antibiotics to treat those infected and prevent the disease in people who might have been exposed to the bacteria.

From the beginning of this epidemic, the WHO, along with health officials in Madagascar, identified more than 7,000 potential plague cases among the friends, families, and contacts of people who were suspected of having the disease. Then, incredibly, the WHO helped 95 percent of those people follow a seven-day course of preventive antibiotics. “Only nine contacts developed symptoms and became suspected cases,” the WHO reported.

The UN agency also supported the Ministry of Public Health of Madagascar in a response that included strategies like:

Training more than 4,400 “contact tracers” who followed up with people who may have been exposed to someone infected with plague

Boosting the epidemiological surveillance in all of Madagascar’s affected districts

Controlling rodents and other vectors that carry plague bacteria

Raising public awareness through campaigns about how to prevent the spread of plague

Screening airport passengers to make sure people with plague aren’t traveling to other countries

Helping the nine countries and territories with travel and trade links to Madagascar prepare for potential plague cases by enhancing their surveillance for the disease, and getting supplies like antibiotics ready

“We are now better equipped to work with countries to prepare for emergencies, to detect warning signs early and to respond quickly,” said WHO spokesperson Tarik Jasarevic.

For now, the public health response is working. The number of new plague cases has been steadily declining since mid-October.

That’s excellent news — both for the people of Madagascar and for the nine neighboring countries and territories that were at risk of outbreaks. Still, it’s early in Madagascar’s plague season, which typically runs to April, so the outbreak may not be snuffed out just yet.