The woman, Huang Cuilian, told the state news media that she screamed and ran off when the men stamped their feet in a threatening manner. When Ms. Huang, accompanied by factory guards, returned to confront the men, the standoff quickly escalated.

Image A family with a halal restaurant in Shaoguan was hired to cook for the Uighur workers after they were moved from the factory. Credit... Alan Chin for The New York Times

The Uighur workers have since been sequestered at an industrial park not far from the toy factory. Officials refused to allow a reporter access to the workers, and a large contingent of police officers blocked the hospital rooms where two dozen others were recovering from their wounds.

“They want to lead a peaceful life and not be bothered by the media,” said Mr. Chen, the Shaoguan official. He said the government of Guangdong Province, where Shaoguan is located, and the factory would provide them employment at a separate plant.

Officials at Early Light, a Hong Kong company that is the largest toy maker in the world, declined to comment.

In the city of Kashgar, the ancient heart of Uighur civilization, the Shaoguan killings have inflamed longstanding anger over the way China manages daily life in Xinjiang. Many Uighurs complain about policies that encourage Han migration to the region and say the government suppresses Uighurs’ language and religion. When it comes to employment, they say coveted state jobs go to the Han; a 2008 report by a United States Congressional commission noted that government job Web sites in Xinjiang set aside most teaching and civil service positions for non-Uighurs.

“If we weren’t so poor, our children wouldn’t have to take work so far from home,” said Akhdar, a 67-year-old man who, like many others interviewed, refused to give his full name for fear of reprisals from the authorities.

The Uighurs who work at the Shaoguan toy factory, all of them from Shufu County outside Kashgar, are part of a growing wave of 1.5 million people who have migrated from Xinjiang to more prosperous cities of coastal China. This year, more than 6,700 young men and women left Shufu County, according to government figures, part of an ambitious jobs export program intended to relieve high youth unemployment and provide low-cost workers to factories.