A confrontation involving axes, knives, at least one gun and ending with the burning down of a house left 21 people dead in China's troubled far-west region of Xinjiang, a government spokeswoman said on Wednesday, calling it a "terrorist attack".
Nine residents, six police and six ethnic Uighurs were killed in Tuesday's violence, said Hou Hanmin, spokeswoman for the Xinjiang government.
It was not immediately clear how many burnt to death.
Hou did not name any group, but China has blamed previous attacks in energy-rich Xinjiang - strategically located on the borders of Afghanistan, Pakistan, India and Central Asia - on Islamic separatists who want to establish an independent East Turkestan.
Many Uighurs, a Turkic-speaking Muslim people native to Xinjiang, chafe at Chinese controls on their religion, language and culture.
Three "community workers" were patrolling a neighborhood of Bachu County, known as Maralbexi by Uighurs, in Kashgar after a tip-off that there were "suspicious people" in a private house, Hou said.
One of the three used a phone to call for help after they found a number of knives, resulting in their being killed by 14 Uighur "rioters" in the house, Hou said.
"The community people were just conducting regular checks, but the action from the rioters was planned and well prepared," Hou said. "It's certainly a terrorist attack."
Several police and other "community workers" came in different groups to the home where the Uighurs used axes and large knives to slash the police officers and workers, Hou said.
Only one police officer was armed with a gun, she said.
The battle ended with the gang members burning down the house, killing the rest of the people there, Hou said. Eight people had been detained.
Dilxat Raxit, spokesman for the exiled World Uyghur Congress, said the violence was sparked by the shooting and killing of a young Uighur by "Chinese armed personnel", prompting the Uighurs to fight back.
"To suppress the fight among the Uighurs, China can engage in arbitrary shootings," Raxit said in an emailed statement.
Some Chinese officials also blame such attacks on Muslim militants trained in Pakistan. But many rights groups say China overstates the threat to justify its tight grip on the region.