Witnesses to chilling violence at a Chinese train station placed under heavy security on Sunday recalled moments of fear and chaos after at least 29 people were killed in what authorities called a terrorist attack by Xinjiang militants.

Officials said a group of knife-wielding "terrorists" from the restive Xinjiang region launched a premeditated attack at the Kunming Railway Station in China's southwest on Saturday night. More than 130 people were wounded.

Armed riot police stood guard as people streamed into the railway station on Sunday only hours after the attack, one of the worst of its kind in China in recent memory.

Standing near shops about 50 metres from the site, a parking attendant surnamed Chen said he could not believe what was happening when he saw the attackers.

"I walked out and I saw a person with a knife this big, Chen said, spreading his arms wide.

"Then I saw five or six of them. They all had knives and they were stabbing people madly over by the first and second ticket offices," he said.

Police shot four of the attackers dead and captured one, state news agency Xinhua reported. About five others were on the run, it said.

Xinhua quoted the Kunming city government as saying evidence at the crime scene showed the attack was carried out by Xinjiang separatist forces.

The attack comes at a sensitive time as China gears up for the annual meeting of its largely rubber-stamp parliament, which opens in Beijing on Wednesday and is normally accompanied by a tightening of security across the country.

Word of the violence spread quickly, with graphic pictures that showed bodies covered in blood posted to the Twitter-like microblogging service Sina Weibo - posts that were later deleted by government censors. State television showed police wrapping a long, sword-like knife in a plastic bag.

Shop and restaurant workers said hundreds of people had fled into their stores seeking refuge.

"Last night everyone ran over into my supermarket. The supermarket was full of people, including two passengers who had been stabbed," Ren Guangqin said inside his supermarket.

"I was terrified. They were killing people. How could I not be scared?" said 28-year-old Ren.