ELEPHANTS had it rough during Angola’s long civil war. Rebels shot them for food and ivory that they traded for arms. When fighting ended in 2002, few elephants remained. But others have since migrated in from countries such as Botswana, where there are so many jumbos that they scarcely have room to swing a trunk.

When they first galumphed into Angola, the elephants faced an unfamiliar menace: the millions of landmines left over from the country’s decades-long conflict. José Agostinho, who works for the HALO Trust, a demining charity, recalls arriving in the south-eastern town of Mavinga in 2004 to help demine an area not much larger than 15 football pitches. On it, he saw the carcasses of three elephants killed by landmines.

Since then, however, it seems that elephants in Angola have learned to sniff out and avoid landmines, says Mr Agostinho. The number killed by them was high in the early years after the war, but it has fallen sharply, says Roland Goetz, a wildlife adviser to Angola’s government.

The landmine-death rate has fallen even as the elephant population has increased in Angola’s most heavily mined province, Kuando Kubango in the south-east. Elephants tracked using GPS collars walk through mined areas in Angola “successfully and repeatedly”, says Werner Myburgh, the head of South Africa’s Peace Parks Foundation, a partly government-funded outfit that helps establish cross-border wildlife sanctuaries in the region.

Intrigued by this, the US Army’s Research Office has been testing the ability of a group of tame elephants in South Africa to find traces of TNT, an explosive, amid decoy odours of bleach, petrol, soap and tea. The elephants passed with “flying colours”, says Jessica Brown, who ran the project. The results of the experiment will be published this year.

An elephant that has survived or seen a landmine blast can alert an entire herd to the danger with a gesture or very-low-frequency rumble, says Joyce Poole of ElephantVoices, an American-Norwegian NGO.

It can take a long time for knowledge gleaned from accidents to spread through a large, dispersed population. As a ranger in Namibia’s Etosha National Park in the 1980s, Mark Paxton often encountered elephants whose trunks had been partially blown off when they inquisitively sniffed a mine. Today elephants seem warier of them, says Mr Paxton, now the owner of Shamvura Camp, a Namibian game lodge near the Angolan minefields. Sadly, much of their hard-earned knowledge may be lost because of a surge in elephant poaching—a danger that is less easily sniffed out and avoided.