As governments around the world have stepped up regulation of these so-called precursor chemicals, the Mexican cartels have increasingly turned to Chinese chemical factories.

Mr. Guajardo, Mexico’s ambassador from 2007 to 2013, said his efforts to persuade Chinese authorities to restrict the export of these chemicals, which are banned in Mexico, came to naught. Instead, he said, Chinese officials said the problem was best handled by Mexican customs agents or claimed that Mexico’s written requests for assistance had used the incorrect typeface or were improperly translated into Chinese.

“In all my time there, the Chinese never showed any willingness to cooperate on stemming the flow of precursors into Mexico,” he said in a telephone interview.

At the same time, clandestine Chinese labs manufacture and export their own meth and other synthetic drugs around the world. In 2013, the police dismantled nearly 390 meth labs in China, more than in any other country in the region, according to a United Nations report released in May.

These manufacturers have flourished in part because the country’s huge chemical industry is weakly regulated and poorly monitored, officials say, making it easy for criminal syndicates to divert chemicals with legitimate uses in making medicine, fertilizer and pesticides into the production of new and dangerous drugs.

The labs have also figured out how to stay one step ahead of laws banning illicit synthetic drugs simply by tweaking a few molecules, creating new and not-yet-illegal drugs.

Since 2008, the number of new psychoactive substances reported to the United Nations Office on Drugs and Crime has soared more than eightfold to 541, far outpacing the 244 drugs controlled under global conventions. Often sold as “legal highs” and “research chemicals,” these drugs are designed specifically to exploit an outdated international legal framework.