Defendants sit in front of police officers at a courtroom in Kunming City during the trial of four people accused of participating in an attack at a train station in southwestern China. (Reuters Tv/Reuters)

A Chinese court sentenced three men to death and a woman to life imprisonment for organizing or carrying out a knife attack in March that left 31 dead at a train station in the southwestern city of Kunming.

The attack on the railway station, in which 141 people were also wounded, shocked China, signaling that tensions between the nation’s ethnic Uighur minority and Han majority were spreading outside the Uighur homeland of Xinjiang.

The defendants’ ethnicities were not mentioned, but all had Uighur-sounding names and listened to court proceedings through headphones, presumably providing simultaneous translation into their language.

An upsurge in Xinjiang-related violence, which Beijing says is inspired by a combination of separatism and Muslim religious extremism, has prompted the authorities to tighten already suffocating controls in the region, including over Islamic religious practice.

Chinese authorities have said the group responsible for the Kunming attack was trying to leave the country “to join jihad” abroad but when prevented from doing so had hatched a plot to carry out a terrorist attack within China.

According to the Kunming court's microblog, the attack was planned at a hair salon in the city of Gejiu, not far from the Vietnamese border, with the group making black jihadi flags and watching videos made by overseas Islamist extremist groups.

The three men, Iskander Ehet, Turgun Tohtunyaz and Hasayn Muhammad, were sentenced to death for organizing and planning the attack. But they apparently decided to renew their bid to flee China and were arrested at the border two days before the attack.

After losing contact with the three men, five other members of the group went ahead with the attack, the court heard. Four were killed on the spot, while the fifth, Patigul Tohti, a woman, was injured and arrested. The court said Tohti could not be sentenced to death because she was pregnant at the time of her detention.

A SWAT police officer told China Central Television that he had arrived on the scene in March to see people pinned to the ground as attackers slashed them with knives.

"I fired a warning shot and told them to put the knives down, but they charged toward me," he said, adding that the person nearest him was dressed in black with his face covered. “When he was about one meter from my gun, I saw the knife was about 60 to 70 centimeters long, and I shot him down. The other four people weren't stopped by this and kept running toward me, wielding their knives, so I shot them too."

Speaking with his back to the camera, and his helmet on, the officer said the encounter was over in 15 seconds.

With armed police present inside the courtroom, the trial took less than a day.

On Thursday, China’s top prosecutor called for fast-track trials of “terrorists, religious extremists and makers of firearms and explosives.” Since a bomb attack in the city of Urumqi in late May that killed more than 30 people, China has executed more than 20 people for involvement in Xinjiang-related terrorist attacks.

Human rights groups say repression is widespread in Xinjiang, and the judicial system is heavily stacked against Uighur suspects, while exile groups said that repression was the real reason the group turned violent.

“Under a hopeless situation where they could not leave the country and at any time faced the threat of arrest, China should take the main responsibility for promoting policies of hostile repression that triggered this incident,” Dilxat Raxit, Munich-based spokesman for the World Uyghur Congress, said in an e-mailed statement.

Xu Yangjingjing contributed to this report.