BEIJING 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".

It was the deadliest violence in the region since July 2009, when Xinjiang's capital, Urumqi, was rocked by clashes between majority Han Chinese and minority Uighurs that killed nearly 200 people.

Nine residents, six police and six ethnic Uighurs were killed in Tuesday's drama, 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 neighbourhood 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.

Some Chinese officials 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.

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 retaliate.

"The information that we've received is that from last night till this morning, the authorities have flooded the streets with armed men," Dilxat Raxit said by phone from Sweden where he is based.

"After the incident, the locals' mobile phone and internet connections were cut off. Today it has recovered slightly, though not completely."

Chinese Foreign Ministry spokeswoman Hua Chunying said the "violent terrorist acts" would not win popular support.

"The current situation in Xinjiang is good, but a small group of terrorist forces is still trying every possible means to disturb and destroy the present stability and trend of development in Xinjiang," Hua told reporters.