There are differing accounts of what sparked the violence
Two men have been sentenced to death and three more jailed over a clash in China's far-west Xinjiang region that left 21 people dead.
The incident happened on 23 April in a town in Kashgar prefecture. Fifteen officials or security personnel were among those killed.
China said it was a planned attack by a "violent terrorist group".
But other accounts dispute this, attributing the confrontation to ethnic tensions in the restive region.
Xinjiang is home to the Muslim Uighur minority, who make up about 45% of the region's population but say an influx of Han Chinese residents has marginalised their traditional culture.
The authorities often blame violent incidents in Xinjiang on Uighur extremists seeking autonomy for the region.
Uighur activists, meanwhile, accuse Beijing of over-exaggerating the threat to justify heavy-handed rule.
Verifying reports from Xinjiang is difficult.
While foreign journalists are allowed to travel to the region, they frequently face intimidation and harassment when attempting to verify news of ethnic rioting or organised violence against government authorities.
The BBC team that visited the site of the incident to try to clarify details were taken by police to a government compound and subsequently ordered to leave.
The two men sentenced to death by Kashgar's Intermediate People's Court on murder and terrorism charges were named in state media as Musa Hesen, the co-founder of the "terrorist group", and Rehman Hupur.
Three other men were jailed for terms ranging from nine years to life.
The group had been "carrying out illegal religious activities (and) promoting religious extremism", Xinhua news agency reported, citing a court statement. They had also "made 10 explosive devices and carried out explosive tests", it said.
The violence was sparked when three officials saw suspicious behaviour at a house, Chinese reports say.
Residents seized the officials and several more police who came to the scene, many of whom burned to death when the house was set on fire. Security personnel shot six suspects, Chinese reports say.
But a group of local people in Selibuya town, where the clashes happened, told the BBC that the violence involved a local family who had a long-standing dispute with officials who wanted the men to shave their beards and the women to stop wearing full veils.
A spokesperson for the World Uighur Congress, an umbrella organisation of Uighur groups, also disputed the government's version, saying the clashes were a result of a government clean-up campaign.
The incident comes amid rumbling ethnic tensions between the Muslim Uighur and Han Chinese communities.
In 2009 almost 200 people - mostly Han Chinese - were killed in deadly rioting in Xinjiang's capital, Urumqi.
There have been sporadic eruptions of violence since then - in June 2013, 35 people were killed in rioting in the township of Lukqun, about 200km (120 miles) south-east of Urumqi.