W HEN POLICE raided an apartment used by a chemicals exporter in the northern city of Xingtai just over a year ago, they found a team of English-speaking saleswomen hired to advertise illegal wares on foreign websites. Last month their boss was among nine people who pleaded guilty in a Chinese court to producing and mailing narcotics to America. The drugs included fentanyl, a potent opioid painkiller that has killed tens of thousands of people. The investigation began with a tip-off from American police, who were investigating one of the gang’s customers. They said the joint Chinese-American effort had prevented 20m doses of fentanyl from being sent abroad.

On December 1st China gave another hint that it was getting tougher on the drug that has blighted America (see article). The country’s president, Xi Jinping, agreed to close loopholes that allow some unlicensed distributors of fentanyl to operate legally. Foreign governments, especially America’s, have for years been calling on the Communist Party to suppress the trade. The White House called Mr Xi’s pledge, made during a meeting with President Donald Trump on the sidelines of a G 20 summit in Argentina, a “wonderful humanitarian gesture”. But it is unclear whether much will change as a result, in China or elsewhere.

In the 19th century China was defeated in two wars against Britain that were caused by British sales of contraband opium produced from Indian-grown poppies. These days the world’s most popular recreational drugs are increasingly made from synthetic ingredients, not plants. The fringes of China’s vast pharmaceutical and chemical industries have proved to be good places to produce them. The country is the world’s biggest exporter of pharmaceutical ingredients and accounts for one-third of global sales of chemicals. Weak regulation has enabled the diversion of legally produced drugs into underground markets, according to the US -China Economic and Security Review Commission, a congressional body that gives advice to the American government on China policy. It has also made it easier for people to find the ingredients, kit and talent necessary to cook them up illegally.

For years the biggest such business was making stimulants such as amphetamines and methamphetamines, which are also produced in neighbouring countries (see article). Such drugs have been growing increasingly popular among China’s drug-takers and in the rich world. But the synthetic opioid crisis in America has created new business opportunities. America says most illicit fentanyl comes from labs in China. Finished opioids or the ingredients needed to produce them are sold by Chinese distributors to gangs in Mexico and Canada, who smuggle them into America. They can also be bought online and shipped directly to American buyers using international mail services.

Fentanyl’s unusual potency—30 times greater than heroin—makes it easy to smuggle powerful amounts in small, hard-to-detect quantities. It can be disguised, for example, as the tiny sachets of desiccant used to stop many packaged goods from going soggy. In 2017 America’s Department of Justice guessed that fentanyl purchased in China for $3,000-5,000 could be worth around $1.5m on American streets. About 29,000 people in America died from overdosing on opioids such as fentanyl in 2017, up from about 5,000 in 2014.

Chinese officials say that drugs of this type are not yet commonly abused in their own country (the crisis in America owes much to copious prescription of legal painkillers; these have never been as readily available in China). Until recently the production and sale of synthetic opioids was not tightly controlled. For years Chinese distributors sold fentanyl openly to people abroad through their websites. Some still do. They have managed to stay ahead of gradually tightening laws by slightly altering their products’ chemical recipes. The new types of fentanyl that result are not banned under Chinese legislation, but are just as dangerous as older ones.

Exactly how the Chinese government will implement Mr Xi’s promise to close legal loopholes has yet to be spelled out. It appears to be mulling a restriction that would embrace all existing types of fentanyl, as well as fentanyl-like compounds that have yet to be invented (at present it has to introduce a new prohibition each time drug-cooks tweak their product). Lawmakers everywhere have usually preferred to avoid such all-encompassing measures, in part so as not to stifle pharmaceutical research, but lately they have been thinking again. America’s Drug Enforcement Administration introduced sweeping new controls on all fentanyl-type substances in February. It said this was an emergency measure that would initially last two years. The hope on both sides of the Pacific is that China’s new regulations—if and when they are enacted—will persuade at least some of the country’s fentanyl-makers to find alternative work that does not threaten lives.

Yet enforcement will be a tough challenge. Local officials regard boosting economic growth as their priority. They are often reluctant to step up inspections that might impose costs both on government and industry. Some take kickbacks from manufacturers. Lapses in the regulation of China’s drug and chemical industries are common, despite the government’s incentive to avoid such slips and the public outrage they cause. (This summer Chinese parents found out that more than 200,000 babies may have been given substandard vaccines, the latest of several such public-health scandals.) Sending illegal materials by post is already banned. But the Chinese postal system handles more than 75,000 new parcels every minute. Finding drugs in them, and tracing them to their source, is fiendishly difficult.

This is a good reason for America to focus on remedies at home. It could invest a lot more in finding ways to reduce the harm caused by opioid addiction, including treatments that reduce the craving of addicts. And China needs to prepare itself for the possibility that powerful synthetic opioids will catch on at home. The country’s punitive drug policies, which include detaining many addicts, look even worse-suited than America’s to handling the health crisis that may result.