Courts in China's restive far western region of Xinjiang have sentenced four people to death for violence in two cities over the summer which left 32 people dead, a government website said.

The government blamed the incidents in Kashgar and Hotan -- both in the majority Uighur southern part of Xinjiang -- on religious extremists and separatists who want to establish an independent state called East Turkestan.

Many Uighurs, a Turkic-speaking Muslim people native to Xinjiang, resent Chinese rule and controls on their religion, culture and language.

The courts in the two cities found the four, who all appeared to be Uighurs judging by their names, to be guilty of crimes including involvement in terrorism, arson and murder, the Xinjiang government website said late on Wednesday.

Both cases were heard in open courts in accordance with the law, with representatives from all walks of life attending, the report said. During the trial, the accused ... confessed everything.

But the Germany-based exile group the World Uyghur Congress said the four had been tortured while in detention and were given only very limited access to lawyers.

The so-called open trial is a special type of Chinese political swindle, spokesman Dilxat Raxit said in an emailed statement.

The incidents were the worst violence Xinjiang has experienced since 2009 riots in regional capital Urumqi, when clashes between majority Han Chinese and Uighurs killed nearly 200 people, many of them Han.

Xinjiang is strategically vital to China and Beijing has shown no sign of loosening its grip on the territory, which accounts for one-sixth of China's land mass and holds rich deposits of oil and gas and borders Afghanistan, Pakistan, India and Central Asia.

Beijing, wary of instability and the threat to the Communist Party's grip on power, often blames what it calls violent separatist groups in Xinjiang for attacks on police or other government targets.

It says they work with al Qaeda or Central Asian militants, though experts doubt the extent of those contacts.