Martin Leclerc and a colleague were only out of the vehicle for a few minutes when they heard a crash in the trees somewhere up the gravel road. They knew the bear was nearby since they had a GPS tracking collar on the animal, but getting a reading more precise than a few dozen yards away was difficult, particularly if the bear was moving as fast as this one.

The researchers edged a little closer to the car, and suddenly a female brown bear and two cubs burst out of the forest and tore across the road around 75 yards ahead of them. Only a few seconds behind came another bear — likely a male — hot in pursuit of a twisted idea of the meaning of family life.

Leclerc, a Ph.D. student in biology from the Université de Sherbrooke in Quebec, was conducting field research as part of a larger study on how bears behave in the presence of humans. The anecdote wasn't from work included in his thesis, but displays the kind of behavior he researched. One surprising finding from that research, published in the Proceedings of the Royal Society B, shows that female bears with cubs may use humans as a kind of shield to ward off the danger of infanticide.

As urban areas continue to grow across the planet, many animals are finding creative ways to make the best of losing prime habitat to human infrastructure. While we may see their presence as some kind of break in an imaginary border we've created between our own concepts of nature and civilization, the animals themselves make colder calculations based on survival and relative danger.

Male Eurasian brown bears have a rather Machiavellian approach to family formation. During mating season, some males will kill the cubs of a female they encounter with the knowledge that within a few days, she’ll become open to reproducing again.

“The main reason they kill the cubs is to gain higher sexual opportunity,” Leclerc says.

But male bears are often leery of getting too close to human civilizations, which may provide the females an opportunity. Leclerc and his coauthors looked at extreme cases from 2005-2012 in which all of a bear’s cubs survived, or all of them were killed, since males intent on guerrilla family-forming will usually wipe out the whole litter if they can.

GPS data and spot-checking from the ground and helicopters to see whether cubs had survived the mating season showed that the most successful mothers were the ones that hung out more often relatively closer to humans, while those that often avoided human infrastructure were the ones that lost cubs.

“In a way it's the best of two evils to go close to humans,” says Leif Egil Loe, a professor of wildlife biology at the Norwegian University of Life Sciences, who was not involved in this study. In other words, humans may stress bears out, but for mother bears this danger is trumped by the fear of male bears in mating season.

“The moment that mating season is over and when the chance of her cubs being killed by a male is over, she instantly switches back to avoiding humans. It’s very much that she takes the opportunity of this time window when the humans are perceived as less threat than the males that come and victimize her," Loe told Smithsonian in a phone conversation. Loe says the study is great as it shows a new intraspecies mechanism for the concept of wildlife using a human shield — something that can be common where predators are afraid of humans. Loe says other interspecies human shield relationships have been found. Grizzlies also avoid humans in some areas, so moose hang out near us. Other examples have been found between elk, humans and wolves as well as roe deer, humans and lynx. He has studied a similar relationship himself involving spotted hyenas and mountain nyalas in the Bale Mountains National Park in Ethiopia.

The hyenas are the only major predator of nyala, an iconic antelope in the area, but like the male brown bears of Leclerc’s study area, fecal sample analysis shows that hyenas prefer to keep to the wilder center of the park.

Humans don’t live in the national park, but many pastoralist settlements ring the periphery of the protected area. “The pastoralists in this area very actively protect their cattle from predation,” Loe says, adding that this involves actively chasing the hyenas away.

The mountain nyala seem to have taken notice of this opportunity, for GPS data from the antelopes shows that while they spend their days inside the park, many of them head for the periphery at night when the hyenas are on the hunt for meals.

Loe said nyala are more skittish in other areas with trophy hunting or poaching issues, but locals in the study area didn’t shoot them. Loe and his team ruled out the idea that the nyala approached humans to seek out food, as crops are only around seasonally while the horned animals spend their evenings around humans year-round.

"Because of that we concluded that it was not to seek food but to seek protection,” Loe said, adding that locals also believed the nyala hung around them for protection.

He noted that their data couldn’t show whether hyenas still attacked nyala near human settlements, but they could find no alternative explanation for why the antelopes spent their time around humans.

There could be conservation and wildlife implications for both of these situations. Loe says that the study showed that nyala, listed as threatened by the International Union for the Conservation of Nature, will only hang around low-density human populations, not areas where there are larger settlements. “For small populations where single individuals are important for population viability, the human shield mechanism can be important for conservation,” he said in a follow up email. "This obviously only works in locations or at times of year where humans are associated with low risk. Animals are good at adapting to shifting risk levels (sometimes humans are dangerous, other times not)."

In the case of brown bears, Leclerc says that the information they’ve gathered is important for the understanding of bear behavior and why and under what conditions the animals may come more often into conflict with humans.

He says that one of the popular beliefs about bears is that they end up hanging around human settlements in order to feast on garbage or yappy Chihuahuas. But his study adds to evidence that bears may have a different reason for risking stressful human contact.

“Better knowing where bears are and how they use different landscape structures is always useful for management,” he said.