TAJIKISTAN is the poorest republic of the former Soviet Union, yet its capital, Dushanbe, is awash with cash, construction and flash cars. It is easy to guess where the money comes from. Tajikistan has little industry but, with a porous 1,300-km (800-mile) border with northern Afghanistan, it is at the heart of a multi-billion-dollar network smuggling heroin. Bizarrely though, unlike other transit countries such as Mexico, Tajikistan sees little drug-related violence. The heroin, instead, seems to help stabilise the place.

The UN Office on Drugs and Crime estimates that some 30% of Afghan opiates—including 90 tonnes of heroin a year—pass through Central Asia on their way to Russia, most of them through Tajikistan. The trafficking route is the country's most valuable resource, and its anaemic economy is hooked. Researchers believe the industry is equivalent to 30-50% of Tajikistan's GDP. But officials from NATO, which is trying to extract itself from the region, say they have no intention of upsetting the status quo.

The first five years after Tajikistan's independence in 1991 were marred by civil war. After that, President Emomali Rakhmon consolidated his power through patronage and cash. Foreign diplomats say they have no proof that he is involved in the drug trade, but they point out that those managing the smuggling routes owe their jobs to him or to other high-level officials. They maintain local security in exchange for the state's hands-off approach.

For most Tajiks, the alternative is so frightening that they are happy to look the other way. If senior officials clamped down on the trafficking of heroin, they would have to arrest powerful political figures, writes David Lewis of Britain's Bradford University; this could spark serious violence and possibly reignite civil war.

Figures from Tajikistan's Drug Control Agency show an 80% drop in opiate seizures since 2001. During the same period the UN drugs office says production in Afghanistan almost doubled. This means only a tiny fraction of the heroin slipping through the region is stopped. Although there are regular busts, they usually involve low-level upstarts with no connections. In this way, diplomats say, officials protect their own trafficking networks, allowing no footholds for smaller players.

Foreign donors have spent hundreds of millions of dollars on border security and counter-narcotics projects designed to cut trafficking and boost Tajikistan's legal economy. Instead, these initiatives help to control the trafficking by helping officials take out rivals. Donors subsidise basic government functions, including the drugs agency, while watching Mr Rakhmon construct flamboyant new palaces and the world's tallest flagpole.

Foreign officials admit to having little incentive to challenge the authorities' hold on drug smuggling. Besides, taking a large amount of cash out of the economy could plunge the country into chaos. The real mission, says a Western diplomat, is keeping the government happy to assist the NATO war effort in Afghanistan. Every American soldier deploying to Afghanistan flies over Tajikistan, he says. “Are we going to jeopardise that? No way.”

A European official says the people doing the trafficking are the same counter-narcotics people that Western countries are training. “We give them cars, and they use them to transit drugs—look at their houses,” he says of the mansions cropping up around town.

For the average Tajik, life remains a struggle. Tajikistan is the country most dependent on remittances in the world. Transfers from the million or so Tajiks living abroad are equivalent to 45% of GDP. Poverty is widespread: half the country's 7.7m people live on less than $2 per day. In winter many villages have only two hours of electricity a day.

With the economy so addicted to heroin, there is little incentive to build or produce other things. Meanwhile, Porsches continue to cruise around Dushanbe, often stolen in Europe and traded for drugs along the Silk Road.