JOHANNESBURG, South Africa — How do you stop a six-ton hungry elephant from rampaging through your garden?

For communities living alongside southern Africa’s national parks, the question has become more pressing in recent years. The African elephant population has boomed, leading to increased conflict with humans as elephants roam beyond park borders.

The elephants raid crops, threatening the livelihoods of farmers, and can also cause significant property damage in villages.

But researchers have found a crafty way to deter marauding elephants: African honeybees.

"Elephants tend to crop-raid at night time, and farmers confronting elephants in the dark are often left with no choice but to throw stones and firecrackers or shoot bullets into the air to try to scare them away," says the Elephant and Bees Project, run by the conservation group Save the Elephants.

"This confrontation leads to heightened aggression and some elephants will charge and attack. These negative incidents often lead to terrible injuries or deaths of both people and elephants."

And that's where the bees come in as potential life-savers. Samburu people in northern Kenya had noticed that elephants were scared of the insects. Researchers investigated further and found that not only were elephants alarmed by the buzz of bees, but they also displayed behavior warning other elephants away from the area.

The elephants dislike being stung by bees, particularly around their eyes and inside their trunks. Studies led by Dr. Lucy King in Kenya found that elephants fled at the mere sound of buzzing bees — including audio playbacks.

Fences hung with beehives have also proved successful, leading to the creation of a manual on how to build "beehive fences."

While other methods had been tried before — loud noises, fire, chilies, thorn fences — bees have proved a more successful and relatively inexpensive elephant deterrent.

A recent experiment at South Africa's Kruger National Park found that elephants responded most strongly to a mix of bee noises with the scent of honey.

"Bees represent a promising tool for managing elephant movements with potential to contribute to long-term conservation of the species by offering an alternative to lethal management of problem elephants," researchers from Johannesburg's University of the Witwatersrand wrote for The Conversation Africa.

There are other positive effects: For one thing, bees help pollinate crops. And in some places, local farmers have learned beekeeping skills and are now producing honey for sale — marked as "elephant-friendly honey."