IN THE oasis town of Kashgar, in the far western region of Xinjiang, the authorities are keen to stop the spread of uncensored news about recent bloodshed in the area. On July 28th the deadliest outbreak of unrest in years involving Muslim Uighurs took place. By official accounts nearly 100 people were killed; Uighur exiles say many more than that died. Officials have blamed the incidents on “terrorists”. Uighurs blame government heavy-handedness. Inside a clothing shop near central Kashgar, a young Uighur says many members of his ethnic group have been taken away by police in recent months, some of them merely for talking to outsiders.

In May the authorities declared a “people’s war” on terrorism in Xinjiang. The recent violence suggests victory is far away. In the attacks near Kashgar, police say that a gang of Uighurs attacked government offices with knives and axes, killing 37 people, and that 59 of the attackers were gunned down in response. Two days later one of the government’s allies in the war, the chief imam of Kashgar’s largest mosque (pictured), was stabbed to death after morning prayers. His attackers were Uighurs. The government said they were “thugs influenced by religious extremist ideology”. Two of them were shot dead and a third arrested.

The government’s increasingly repressive security measures make it difficult to gain a clear account of the recent incidents in Xinjiang, where Turkic-speaking Uighurs once formed an overwhelming majority and now feel increasingly marginalised by Han Chinese immigrants. Police routinely stop foreign journalists from approaching trouble-spots. Social media are rigorously censored. Kashgar police stop motorists going into and out of Uighur sections of the city, checking identity cards and belongings. Crimes meriting detention can include carrying too much petrol; it could be used for bomb-making.

The nervousness of the man in the clothes shop is not mere paranoia. The government encourages neighbours and friends to inform on each other. In Kashgar officials have recruited households to monitor their blocks in an authoritarian version of neighbourhood watch. On August 1st, in an anti-terror operation near the city of Hotan, south-east of Kashgar, the authorities claimed to have recruited 30,000 volunteers to help encircle and hunt down ten terror suspects, nine of whom were killed. Officials announced financial rewards of 300m yuan ($49m) for “thousands” of locals who had helped.

The government has been spooked by militant Islam in neighbouring countries (the borders of Pakistan and Afghanistan are less than 300km, or 185 miles, south of Kashgar). It worries that Uighur nationalists are using religion to assert a separate identity. At official “Project Beauty” checkpoints, Uighur women in traditional face-revealing dress reprimand passers-by wearing Islamic veils. In the north-western Xinjiang city of Karamay, a local newspaper said on August 4th that people wearing head scarves, veils or long beards were not allowed to board buses.

The authorities’ fears of terrorism are not fanciful. Random attacks on civilians are becoming more common and the violence is spreading beyond Xinjiang. In October last year Uighurs in Beijing rammed a car into a security barricade near Mao’s portrait in Tiananmen Square. The vehicle exploded, killing six people, including three inside the car. In March as many as eight Uighurs with knives attacked passengers at the railway station in Kunming, killing 29 people. Some Chinese called the incident the country’s “September 11th”, suggesting the shock was similar to that experienced by America in 2001. In April and May two attacks using explosives in the provincial capital of Xinjiang, Urumqi—one at a railway station and the other at a busy market—killed at least 46 people and injured more than 200.

Relations between Han Chinese and Uighurs in the region have deteriorated sharply since 2009, when clashes erupted in Urumqi between Uighurs and Hans, leaving around 200 dead. The government has responded by pouring in money. Xinjiang is due to be connected to the rest of China by a bullet-train track later this year; Kashgar is soon to be connected by expressway to the north of Xinjiang, which officials say will boost the city’s economy. But Uighur grievances have been exacerbated by officials’ intolerance of Islamic traditions and their emphasis on Chinese instruction in schools. Kashgar itself, an historic Uighur market city on the old Silk Road, has demolished and rebuilt vast areas of ancient neighbourhoods, heedless of residents’ complaints.

Activists say the government has used more sticks than carrots with Uighurs since Xi Jinping became China’s leader in November 2012. In January police in Beijing detained Ilham Tohti, a prominent Uighur scholar who is widely considered a moderate advocate for better treatment of Uighurs. On July 30th Mr Tohti was charged with separatism. In Beijing in May, at a meeting of senior officials to discuss Xinjiang, Mr Xi called for “nets spread from the earth to the sky” to catch terrorists.

Mr Xi and the ruling Politburo also discussed improving economic opportunities for Uighurs through even more government spending. Many Uighurs have yet to benefit from rapid urbanisation. Ma Rong, a sociologist at Peking University, found that Uighurs were one of only two ethnic groups in China among whom the proportion of farmers had grown in the decade to 2010, from 80% to almost 83% (the other being Kazakhs, a much smaller ethnic group in Xinjiang). Officials have not pursued efforts to create urban jobs for Uighurs with the same diligence as they have cracked down on their customs.

A young Uighur woman training to be a civil servant, herself a daughter of two government workers, says that as a woman she is less likely to be hassled by security personnel at checkpoints. Last year, however, in her hometown in the southern Xinjiang city of Yecheng, she walked accidentally into a security cordon in a town square. She was confronted by seven or eight men who pointed guns at her. She felt lucky to be able to say, in Chinese, that she was sorry to be there. She says she once bristled at such security measures but now understands the need for them.

Few Uighurs, however, sympathise with the authorities’ controls on their religion. The latest violence erupted at the end of the holy month of Ramadan, during which officials put pressure on teachers, students and civil servants not to observe fasting rituals. Philip Potter of the University of Michigan argues that in the long run, Chinese leaders “have painted themselves into a corner”, deepening the divide between themselves and the Uighurs they govern. Worsening unrest seems certain.