Elephants are able to differentiate between ethnicities and genders, and can tell an adult from a child - all from the sound of a human voice.
This is according to a study in which researchers played voice recordings to wild African elephants.
The animals showed more fear when they heard the voices of adult Masai men.
Livestock-herding Masai people do come into conflict with elephants, and this suggests that animals have adapted to specifically listen for and avoid them.
Prof Karen McComb and Dr Graeme Shannon from the University of Sussex, who led the study, explained that in previous research they had used similar playback experiments to reveal that elephants could tell - from the sound of a lion's roar - whether the animal was a female or a more dangerous male.
Other studies have shown that elephants respond with fear to the scent and even to the red colour of the Masai clothing.
"I've experienced that," explained Prof McComb.
"If you give a Masai man a lift in your car, you can see the elephants behave in a different way around you.
"They're much more wary of the car and you see a lot of smelling and listening."
Prof McComb wanted to find out if the animals used their very acute sense of hearing to identify a potential threat from humans.
The scientists recorded Masai men, women and children saying, in their own language, "look, look over there, a group of elephants is coming".
They also recorded Kamba men saying this phrase.
While cattle-herding Maasai people often encounter free-ranging elephants, which can result in violent conflict, the Kamba people's more agricultural lifestyle does not generally bring them into aggressive contact with the animals.
When the team played recordings of these different voices through a camouflaged loudspeaker, they found that elephant family groups reacted more fearfully in response to the voice of a Masai man, than to a Kamba man's voice - retreating and bunching together defensively.
And the adult male Masai voices triggered far more of these defensive reactions than the voices of women or boys.
An additional and unexpected finding was that when the researchers changed the pitch and frequency of the voices - making a male Masai voice sound more female - the elephants would still react in the same way as they did to the original recording.
"That suggests they're using completely different cues [to us] in order to attribute gender," said Prof McComb.
Frans van der Waal from the Yerkes National Primate Research Center at Emory University, a researcher and the author of several books on animal behaviour, wrote in an accompanying article in PNAS that this finding suggested we had "much to learn about how elephants make decisions".
He added in an interview with BBC News: "Making these kinds of fine distinctions in human voice patterns is quite remarkable."
Prof McComb said the research showed that elephants were "trying to adapt" to human threats.
"Humans are undoubtedly the most dangerous and versatile predators the elephants are faced with these days," she said.
Prof de Waal added: "The more we understand about how elephants navigate their physical and social worlds, and how their behaviour continues to adapt to ever-changing threats, the better able we will be to effectively work to protect them in the wild."