IN CHINA’S far western region of Xinjiang, the authorities are fearful. What they call terrorist attacks carried out by Uighurs, a Muslim ethnic group that regards Xinjiang as its homeland, have killed 400 people in the past couple of years. The latest such incident, on June 22nd, left 18 people dead near the southern city of Kashgar. In recent months officials in Xinjiang claim to have broken up more than 180 terrorist groups—at least one of them reportedly set up by Uighurs who had fought with Islamic State in the Middle East. State television recently aired footage of children being turned into “killing machines” for global jihad at a training camp near the border with Afghanistan and Pakistan. China’s rhetoric is overblown, but the country is right to worry about terrorism. In March last year a group of Uighurs knifed 31 Chinese civilians to death at a railway station in the south-western city of Kunming. China recognises that part of the problem is a home-grown one: that many of Xinjiang’s 10m Uighurs have felt left out of the country’s economic boom. Thanks, not least, to its oil and gas industries, Xinjiang’s own economy has been growing fast, too. But this has mainly benefited ethnic Hans, who form about 40% of the province’s population. Firms in Xinjiang often prefer to employ Hans, because they speak better Chinese and because there is a shortage of skilled Uighurs. Officials say, plausibly, that better education for Uighurs is crucial for improving stability (see article). Overcoming racial prejudice among employers would help. In 2009 long-simmering ethnic tensions erupted into an orgy of rioting in Xinjiang’s capital, Urumqi, leaving around 200 people dead and the region even more ethnically divided than before.

The terrorist murder of civilians is wrong, however beleaguered a people. But China can help bring about the calm it seeks by treating Uighur culture and faith with more respect. Even as officials wage what they call a “people’s war” against terrorism, they inflame Muslim fury by banning women from wearing face-veils and men from growing long beards. Other countries, such as Belgium and France, have also mistakenly banned the veil, but China’s restrictions are especially draconian. In March a man was jailed for six years by a court in Xinjiang for “provoking trouble”; his offences included growing a beard. His wife got a two-year sentence for covering her face. Before the holy month of Ramadan this year, officials reiterated a ban on the observance of fasting rituals by bureaucrats, teachers and students. In January they decreed that pilgrims to Saudi Arabiamust travel in state-organised groups. (Few win permission to go.) Small wonder many Uighurs see what officials call “bilingual education” as a trick to marginalise their language and identity.

Show a little respect

Last year China launched a hearts-and-minds operation in Xinjiang: 200,000 officials were told to spend time living among Uighurs in order to understand their problems. They clearly failed to listen hard enough. Earlier this month, as Muslims in Xinjiang prepared for Ramadan, rural officials near the city of Hotan decided to organise a beer festival. A local news website showed pictures of men glugging down beer in a drinking contest. Uighurs in exile expressed outrage; in a rare climbdown of sorts, the report was censored.

A counter-terrorism law is now being drafted that could allow officials to brand any unauthorised religious activity as “extremism”. That would play into the hands of terrorists. The way to peel violent extremists from the general population is to give Muslims fewer grievances. Heavy-handedness will only make Xinjiang—and the rest of China—less safe.