Image copyright AP Image caption It is not clear how the incident in Selibuya turned so violent

To our left, the desert stretched as far as the eye could see. To our right dry, rocky mountains soared upwards, the landscape harsh and barren, but striking too.

We were heading east from the ancient trading city of Kashgar towards the little town of Selibuya, the scene this week of the worst violence to erupt in Xinjiang since major riots in 2009.

The name, Xinjiang, means "new frontier" in Chinese. It is a vast desert region at the very western edge of China. Geographically and culturally you feel far closer to Central Asia and Afghanistan than Beijing.

Xinjiang is rich in oil and gas. Needing energy to power its hungry economy China is developing this remote province fast. Construction teams are busy building new motorways through the desert. Lines of lorries churn up huge clouds of dust.

But China's rule, and the influx of Chinese workers and money, are causing tensions with Xinjiang's Muslim Uighur population. In this latest eruption, 21 people died.

'Terrorists'

At the edge of Selibuya we slipped past a checkpoint manned by armed police. The government does not want journalists here, so we took care to keep a low profile.

Selibuya is little more than a one-street town. Uighur men wearing their traditional skull-caps guided donkey-carts through the traffic. Women in headscarves sold piles of oranges. The market was busy. On the surface there was not much tension.

But police cars, their lights flashing, were making circuits through town every few minutes in a show of force. Officers on foot were patrolling the streets and, behind the market, more armed police had cordoned off the scene of this week's violence - a two-storey building, part of it burned by fire.

The government's version is that a group of what it calls "terrorists" were in the building, watching jihadi videos and plotting attacks. Three local government workers, sent to investigate a report about suspicious people stumbled on them, were taken hostage and knifed to death, it says.

A dozen police sent to the scene were then forced into a room and burned to death, the government adds. Finally, armed officers allegedly shot dead six of the "gangsters" and captured eight more.

There have been no independent accounts of what happened, until now. The government's story is the only one that has been put forward.

Beards

We found people in Selibuya were scared to talk to journalists. Some said they had been threatened by officials, warned not to speak to outsiders. But we soon found witnesses who cast doubt on the official narrative.

Rather than "terrorists", local people told us the violence involved a local family who had had a long-standing dispute with officials.

Image copyright AP Image caption Local government regulations allegedly say women cannot wear full veils

The family, we were told, were very religious. Officials had, for a long time, been pressuring the men in the family to shave off their beards, and the women to stop wearing full veils covering everything but their eyes.

Local government regulations, we were told, stipulate that women must not wear full veils, and only men who are over 40 years old are allowed to grow beards.

We cannot identify those who talked to us, as they are at risk of official reprisals, but one person said "community workers asked the family not to have their women cover their faces".

"They'd been telling them for a long time. They never agreed," the person added.

Another said: "I'm not well educated, but to my understanding, they are not terrorists."

'Pickaxes'

It is not clear how the dispute turned so violent and why so many police and officials were killed, but a third person said: "I think the government bothered them too many times. They became very annoyed."

Uighurs and Xinjiang Uighurs are ethnically Turkic Muslims

They make up about 45% of the region's population; 40% are Han Chinese

China re-established control in 1949 after crushing short-lived state of East Turkestan

Since then, large-scale immigration of Han Chinese

Uighurs fear erosion of traditional culture

"But beards have nothing to do with terrorists. Asking a woman to take her veil off is disrespectful to her and to her religion."

One eyewitness also gave a graphic and disturbing account of how some of the men in the family died. Again, it does not fit with the official story that the "terrorists" were shot.

"I saw police coming," said the witness, "then I saw one injured man, carrying a knife about a metre long, chasing the police. They all ran into the government compound (across the road from the market).

"The injured man pushed his way in too. He was immediately shot in the leg and fell to the ground. Many police surrounded him. They stabbed him to death with their pickaxes."

The witness went on to describe how three of the man's friends then arrived to help him, saw what had happened and fled to some nearby shops.

"The police tried to catch the men who fought back with axes and knives," the witness told us. "The police shot them twice in the body. They fell to the ground."

'No mercy'

This account clearly raises questions about how at least one of the men died at the hands of police, and, possibly, whether there was justification for shooting the other three as well.

We were unable to find out more about the circumstances surrounding the deaths of the 15 police and government workers the men allegedly killed. We were spotted by police before we could get any information that might have corroborated the government's account of how they died.

Image caption The BBC team was spotted by police before it could get information corroborating the official narrative

Armed police took us to the government compound. An officer there warned us that there were "violent terrorists" still around.

"Some people here are extremists, they've even killed people from their own ethnic group," he said. "Don't you care about your own safety? This is the enemy's war zone. What if someone chops your head off? Go."

So we were ordered to leave Selibuya.

China has dominated Xinjiang for centuries. Its policy there now mirrors that in Tibet, to bring development and economic benefits on the one hand and to deal with security threats with an iron fist on the other.

The recent influx of Chinese migrants means that Xinjiang's 10 million Uighurs are no longer in the majority. Muslims, with a language that is Turkic in origin, many feel their culture is threatened, their religious rights are restricted.

From outside China some preach holy war, posting jihadist videos on the internet, saying Uighurs want their land back and will take up arms to drive out China. These groups are tiny offshoots from al-Qaeda and the Taliban.

There is no conclusive evidence that these militants have the ability to organise attacks inside China.

China has not blamed any single group this time, but it often claims international terrorist groups influence the violence in Xinjiang. There have been a series of attacks in recent years in which police and officials have been targeted, most in and around Kashgar.

Following this latest incident, China's President Xi Jinping said China should "give no mercy to terrorists, and eradicate them". He added: "Xinjiang's anti-terrorism situation is becoming more complicated. The task to maintain stability is more and more difficult."

Local frustration

Critics, though, say that by blaming "terrorists" China is ignoring the root cause of Uighur resentment, and China should rethink its own, heavy-handed tactics.

In response to the deaths in Selibuya the US state department said it "regretted the unfortunate acts of violence that led to these casualties", but it did not condemn the acts as terrorism. Instead, it called on China to "take steps to reduce tensions and promote long-term stability in Xinjiang".

That has infuriated China, which argues that following the Boston bombings the US is guilty of double standards.

Beijing's Foreign Ministry spokeswoman Hua Chunying said: "China ensures the rights of people from all ethnic groups including their religious rights. We are firmly opposed to the US confusing black and white, and right and wrong.

"Not only do they not condemn violent terrorist acts, but they also make casual and irresponsible accusations against China's ethnic policy."

In Selibuya, though, we heard some frustration with China's ethnic policies, at the restrictions on men growing beards and women wearing veils, if they wish.

When we asked to see the scene where the officials were killed, the police told us: "You cannot, the situation is very complicated. Honestly, when we send people there we have plainclothes police and guards, in case we meet an extremist. Two knives and you're chopped."

We never felt threatened while on the streets of Selibuya, but we had to leave the town. So much about this incident and about why 21 people died remains unclear.

What is clear is that such violent incidents keep happening, and people keep dying - Uighurs, Han Chinese and others too.