A Chinese court has sentenced three men to death and a woman to life imprisonment after convicting them of terrorism and murder for killing 31 people in a knife attack outside a railway station.

The convictions were expected when the Kunming Intermediate People's Court opened the trials of the four just hours earlier, with state television showing armed police inside the courtroom.

The railway station attack in March in the southern city shook the country as tensions between the Uighur Muslim minority and the majority Han ethnic group spread beyond the Uighur homeland of Xinjiang.

The defendants showed no emotion during the trial. The three men sentenced to death - Iskandar Ehet, Turgun Tohtunyaz and Hasayn Muhammad - were charged with organising and leading a terror group and murder.

The woman, Patigul Tohti, the only assailant captured alive at the scene of the attack, was convicted on the charges of joining a terror group and murder. The court said she could not be sentenced to death because she was pregnant.

The Kunming court said the suspects, influenced by religious fundamentalism, were part of a terror group that plotted the March 1 attack, when five knife-wielding assailants hacked 31 people to death and injured another 141 people.

Local authorities arrested Ehet, Tohtunyaz and Muhammad two days before the attack as they were attempting to illegally leave China, the court said.

Having lost contact with the three men, five other members of the group mounted the attack as planned, the court said.

Police shot dead four attackers and captured Tohti on the scene, the court said.

Beijing has blamed religion-influenced terrorists with foreign ties for the Kunming attack and other violence that has caused hundreds of deaths this year in and outside Xinjiang.

The court did not identify the suspects' ethnicity, but all have Uighur-sounding names.

Critics say China's repressive ethnic policies and practices as well as economic disenfranchisement have alienated the Uighurs, possibly driving them into religious extremism.

In a written statement, Dilxat Raxit, spokesman for the advocacy group World Uyghur Congress, said China should review its ethnic policies.

"China is shunning the issue that many Uihgurs are choosing to escape the country when they cannot bear the persecution," he said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.