BEIJING — Chinese farmer Ma Yufa grows vegetables on steep terraces in the mountains north of here — the type of terrain better suited for a donkey instead of a tractor. 

But Ma, 80, who lives much the way his ancestors did, said his last donkey died in 2014, and he couldn’t replace her. “There aren’t any donkeys left,” Ma said sadly. “We’ve killed them all.”

China is in the grip of a massive donkey shortage caused by soaring demand for e’jiao — a traditional medicine made by boiling donkey skin. Demand for e’jiao has doubled since 2010, hitting nearly 15 million pounds a year in 2015, according to the national e’jiao association.

The substance was once affordable only by royalty, because one donkey yields 2.2 pounds of e’jiao. 

Only 30 years ago, China had 11 million donkeys — the largest herd in the world — but the number has dwindled to between 3 million and 5 million, despite intensive breeding programs.

“The e’jiao trade is unsustainable in its current form,” said Alex Mayers, with the British-based Donkey Sanctuary animal charity.

In late June, Botswana became the latest country to ban the export of donkey skins in response to reports of hundreds of animals being killed every week.

E’jiao makers, mostly based in the eastern Chinese province of Shandong, deny their product is causing the donkey shortage. They claim they are creating a new role for the animal in the modern world. They also say farmers in China and around the world can get rich by breeding donkeys for them.

“E’jiao is one of traditional Chinese medicine’s three great treasures, along with deer horn and ginseng,” said Liu Guangyuan, vice chairman of China’s largest e’jiao producers, Dong’e E’jiao.

E’jiao’s history is traced to at least the second century B.C. By the 19th century, a royal concubine named Ci Xi used the medicine to prevent her from miscarrying, and her son became emperor of China.

Today the smelly, brown gelatin is marketed as a cure for dementia, infertility and respiratory problems, among other ailments. And the high price doesn’t stop people from buying it. One block made in 2007…