Officials said a group of knife-wielding terrorists from the restive Xinjiang region launched the attack at Kunming Railway Station in south-west China on Saturday night. More than 140 people were wounded.
Armed police guarded people streaming into the station on Sunday hours after the attack, one of the worst of its kind in China.
A parking attendant said he could not believe what was happening: "I walked out and I saw a person with a knife this big," he said, spreading his arms wide. "Then I saw five or six of them. They all had knives and they were stabbing people madly."
Police shot four attackers dead and captured one, state news agency Xinhua said. Five others were on the run. The Kunming city government says evidence from the scene showed the attackers were Xinjiang separatists.
Word of the violence spread quickly, with pictures showing bloody bodies posted to the Twitter-style Sina Weibo network. State television showed police wrapping a sword-like knife in a plastic bag.
Shop and restaurant workers said hundreds fled into their premises. "Last night everyone ran over into my supermarket," Ren Guangqin, 28, said from his shop.
"The supermarket was full of people, including two passengers who had been stabbed. I was terrified. They were killing people."
At Kunming's main hospital scores of wounded victims spilled into corridor. Several had head injuries. Wu Yuheng, 20, said the attackers aimed at people's heads. His scalp was cut with a long knife.
"I was terrified ... they attacked us like crazy swordsmen, and they went for the head and the shoulders, those parts of the body to kill," he said from a hospital bed.
China's domestic security chief Meng Jianzhu vowed those responsible would be brought to justice: "They inevitably will face the severe punishment of the law. We must mobilize all resources," Meng said, echoing comments by Chinese President Xi Jinping.
Meng, a member of the ruling Communist Party's 25-member Politburo, went to Kunming to see the station and victims in hospital.
The attack escalated simmering unrest centred on Xinjiang, a Muslim region in China's far west on the borders of Central Asia.
It is the first time Xinjiang people have been blamed for such a large-scale attack so far from home.
It follows an incident in October when a car hit tourists in Tiananmen Square, killing the three people in the car and two bystanders. China said it was a suicide attack by Xinjiang militants.
Energy-rich Xinjiang's Muslim Uighur people chafe at Chinese restrictions on their culture and religion and violence in Xinjiang has killed more than 100 people in the past year, but Kunming, capital of Yunnan province, is hundreds of miles away.
"China must handle the incident transparently and not let it become a new political excuse to oppress Uighurs," said a spokesman Uighur exile group the World Uighur Congress.
"Serious discrimination and oppressive policies lead to psychological trauma that could provoke victims to adopt extreme measures."
China bristles at suggestions from exiles and rights groups that the unrest is driven by unhappiness at government policies.
The government says it stems from extremist groups who want to establish an independent state called East Turkestan.