“It’s just like water: They’re finding the gaps and the cracks,” Bryce Pardo, an associate policy researcher at the RAND Corporation and a lead author on the organization’s report, said in an interview .

In April, the Chinese government moved to plug those legal holes. It announced it would place all variants of fentanyl — as a class — on the list of controlled substances, rather than individually adding each new version of the drug to the banned list after it had hit the streets. With the export controls that are applied to drugs on the list, the fentanyl variants that had fallen into the legal gray area before were now explicitly banned from being sold abroad.

Tang Jianbin, a lawyer in Beijing who specializes in criminal drug cases, said the move was a significant concession to American demands. The country even had to pass a new law allowing it to designate the entire class of synthetic opioids as controlled substances.

“This legal adjustment is an innovation in our country,” Mr. Tang said.

China made this move in the middle of its protracted trade war with the United States, and it may have been done to help resolve the acrimonious — and continuing — dispute.

Drugs entering China from the West have a dark historical resonance in the country, which is still bitter over the forced importation of opium by the British in the 19th century, the cause of two wars and the ceding of Hong Kong.

And Chinese officials have long bristled at any criticism they were negligent on the law enforcement front and were always quick to point out that fentanyl was a uniquely American problem. Opioid use — and abuse — is far higher in the United States than anywhere else in the world, and there are plenty of other sources of the drug beyond China.

Mr. Yu, the narcotics agency deputy director, cited statistics from the United States Customs and Border Protection showing that of the 536.8 kilograms of fentanyl seized between October 2018 and March 2019, only 5.87 kilograms, or just over 1 percent, was shipped from China .