XINGTAI, China — A court in China convicted and sentenced to death on Thursday a man accused of trafficking fentanyl to the United States after a joint investigation with American law enforcement agencies.

The case, involving nine defendants in all, was a rare example of cooperation against a surge in fentanyl-related deaths that American officials, including President Trump, have blamed directly on China’s lax enforcement and even complicity in fueling a drug epidemic on American streets.

The man sentenced to death, Liu Yong, led an illicit network of labs that produced and shipped packages of fentanyl to American users who were able to place orders online through a dealer simply known as “Diana,” according to the Chinese and American officials.

A judge here in Xingtai, a city in Hebei Province about 220 miles south of Beijing, sentenced Mr. Liu to death after detailing a broad conspiracy to manufacture and smuggle fentanyl that evaded China’s strict controls on pharmaceutical production.