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.
China's domestic security chief, Meng Jianzhu, vowed those responsible would be brought to justice.
"This brutal attack on defenceless, innocent people by violent terrorists devoid of conscience exposes their inhuman and anti-social nature," Xinhua quoted Meng as saying.
"They inevitably will face the severe punishment of the law. We must mobilize all resources and adopt all means to break this case," Meng said, echoing comments made by Chinese President Xi Jinping.
Meng, who is also a member of the ruling Communist Party's elite 25-member Politburo, made an emergency trip to Kunming, visiting the train station and wounded victims in hospital.
The attack marked a major escalation in the simmering unrest that had centred on Xinjiang, a heavily Muslim region in China's far west strategically located on the borders of Central Asia.
It is the first time people from Xinjiang have been blamed for carrying out such a large-scale attack so far from their homeland, and follows a smaller incident in Beijing's Tiananmen Square in October that shook the Communist Party leadership.
China stepped up security in Xinjiang after a vehicle ploughed into tourists on the edge of Tiananmen Square, killing the three people in the car and two bystanders. China labelled it a suicide attack by militants from Xinjiang.
Xinjiang is home to the Muslim Uighur people, many of whom chafe at Chinese restrictions on their culture and religion.
Kunming, the capital of Yunnan province, is hundreds of miles from Xinjiang and has little connection to the violence there that has killed more than 100 people in the past year.
China bristles at suggestions from exiles and rights groups that the unrest is driven more by unhappiness at government policies than by any serious threat from extremist groups who want to establish an independent state called East Turkestan.
One senior member of an advisory body to the parliament said such attacks in China had foreign links.
"The well-planned attack was not an issue of (ethnicity) or religion, it was an issue of terrorism with links to the terrorist forces out of the country," Xinhua quoted PLA Navy Rear Admiral Yin Zhuo as saying.