Ma Mingliang rarely encountered wild elephants while growing up in southwestern China, after centuries of hunting and deforestation nearly eradicated them. Today, the 42-year-old village chief barricades his community to keep them out.

A wandering herd of Asian elephants has captivated China for more than a year with a remarkable trek northwards through farms and cities hundreds of kilometres from their normal range in Yunnan province.

Weighing up to four tons, elephants consume as much as 200 kilogrammes (440 pounds) of food daily
Weighing up to four tons, elephants consume as much as 200 kilogrammes (440 pounds) of food daily AFP / Hector RETAMAL

But an elephant in the street is now a common sight for residents of the animals' home territory on the Myanmar-Laos border, where a recovering elephant population is being squeezed into ever-shrinking habitat, leading to more conflict with humans.

The tension is immediately apparent in Ma's village in Xishuangbanna, a subtropical prefecture the size of a small country where China's elephant population congregates.

The neatly ordered homes of the little community, called Xiangyanqing, climb up a gently sloping hillside, dotted by signs promoting human-elephant "harmony" and encircled by a steel fence separating it from adjacent jungle.

An elephant in the street is now a common sight for Chinese residents of the animals' home territory on the Myanmar-Laos border, where a recovering elephant population is being squeezed into ever-shrinking habitat
An elephant in the street is now a common sight for Chinese residents of the animals' home territory on the Myanmar-Laos border, where a recovering elephant population is being squeezed into ever-shrinking habitat AFP / Hector RETAMAL

The village of rubber-tappers is entered through a wide steel gate that clangs shut at night, when hunger activates the elephants.

A wandering herd of Asian elephants has captivated China for more than a year with a remarkable trek northwards through farms and cities hundreds of kilometres from their normal range in Yunnan province
A wandering herd of Asian elephants has captivated China for more than a year with a remarkable trek northwards through farms and cities hundreds of kilometres from their normal range in Yunnan province Yunnan Provincial Command of the Safety Precautions of the Migrating Asian Elephants / Handout

Still, they regularly find their way in, putting the village in lockdown until the potentially dangerous trespassers wander out, usually after raiding fruit and vegetable gardens.

"Things used to be harmonious before. But there is conflict now," Ma said dryly.

Ironically, successful conservation is partly to blame.

Devoured crops and damaged homes in Xishuangbanna are the prefecture's biggest source of insurance claims
Devoured crops and damaged homes in Xishuangbanna are the prefecture's biggest source of insurance claims AFP / Hector RETAMAL

Asian elephants, which range across South and Southeast Asia, were nearly exterminated within China, leaving only around 150 in Xishuangbanna by the 1980s.

Conservationists say a 1988 hunting ban and strict protection of a sprinkling of fragmented elephant reserves has turned things around.

With no natural enemies, the population has doubled to more than 300 and counting.

Xishuangbanna in 2019 installed a high-tech grid covering hundreds of square kilometres that uses stationary cameras to relay elephant sightings to a command centre, which sends out warnings to communities
Xishuangbanna in 2019 installed a high-tech grid covering hundreds of square kilometres that uses stationary cameras to relay elephant sightings to a command centre, which sends out warnings to communities AFP / Hector RETAMAL

"Compared to when we were kids, there are more baby elephants in the herds now," Ma said.

Weighing up to four tons, they consume as much as 200 kilogrammes (440 pounds) of food daily.

Increasingly, filling up means a raid on a local farm.

China is devising a new national park system to bolster habitat protection for key species like pandas and tigers
China is devising a new national park system to bolster habitat protection for key species like pandas and tigers AFP / Hector RETAMAL

Elephants inflict an estimated 20 million yuan ($3 million) in annual economic losses.

The devoured crops and damaged homes in Xishuangbanna are the prefecture's biggest source of insurance claims, said Zhang Li, an ecology professor at Beijing Normal University involved in elephant conservation policy.

And they killed at least 41 people between 2013 and 2019, Zhang said. Many more are injured each year.

A Xishuangbanna elephant national park has been proposed by Chinese scientists, but it would require the expensive and politically tricky task of reclaiming farmland and relocating hundreds of thousands of residents to link up pockets of habitat
A Xishuangbanna elephant national park has been proposed by Chinese scientists, but it would require the expensive and politically tricky task of reclaiming farmland and relocating hundreds of thousands of residents to link up pockets of habitat AFP / Hector RETAMAL

Attacks, typically by protective mothers or volatile lone young males, can resemble grisly crime scenes.

State media reports on recent cases describe victims being trampled by the surprisingly fast-moving beasts and bludgeoned or throttled by their strong trunks, leaving bones shattered, skulls cracked, and bodies gruesomely dismembered.

Elephants eat in a forest at the Asian Elephant Breeding and Rescue Centre in Xishuangbanna in southwest China's Yunnan province
Elephants eat in a forest at the Asian Elephant Breeding and Rescue Centre in Xishuangbanna in southwest China's Yunnan province AFP / Hector RETAMAL

Communist Party media portrays the 14 wandering elephants -- now pointed homeward after an 18-month odyssey -- as lovable symbols of China's conservation success.

But Chinese scientists say growing habitat loss is part of the problem.

Authorities have been forced to address safety risks.

Xishuangbanna in 2019 installed a high-tech grid covering hundreds of square kilometres that uses stationary cameras to relay elephant sightings to a command centre, which sends out warnings to communities.

The drill: get indoors, hide upstairs out of reach, and don't approach the beasts or use firecrackers to drive them off, which may anger them.

Throughout Xishuangbanna, statues and other imagery celebrate its leading residents -- while stressing giving them a wide berth.

Villagers are adapting.

For decades, Lu Zhengrong's hilltop farming settlement grew rice, corn and other staples, but years of elephant raids prompted a shift.

"The wild elephants became too troublesome and numerous, so we've switched to growing what they don't eat, like tea or rubber," Lu said.

That, however, is accelerating habitat loss, said the ecologist Zhang.

Surging demand for rubber and tea has caused plantations to steadily expand into lands traditionally roamed by elephants but which lack official state protection, squeezing them into protected but increasingly isolated pockets.

Inevitably, they roam out.

Exactly why the 14 wanderers made their mammoth trek northward remains a mystery.

But Zhang said "loss and fragmentation of their habitat may be the root cause," exacerbated by competition for wild food sources as elephant numbers increase.

Things may worsen as climate change is projected to further reduce habitat, he added.

China is devising a new national park system to bolster habitat protection for key species like pandas and tigers.

A Xishuangbanna elephant national park has been proposed by Chinese scientists, but it faces a key obstacle.

A viable park would require the expensive and politically tricky task of reclaiming farmland and relocating hundreds of thousands of residents to link up pockets of habitat.

"I can't say we like it," said Lu.

"But we need balance between this animal and people. We have to protect them."