Another 130 people were wounded in what authorities said was a "premeditated, violent terrorist attack".
Four suspects were shot dead, one arrested and other are being sought Xinhua said.
City officials said evidence implicated militants from the western region of Xinjiang, but this was not verified.
President Xi Jinping and Premier Li Keqiang have sent condolences to the victims and their families.
President Xi urged "all-out efforts" to investigate the attack.
"Severely punish in accordance with the law the violent terrorists and resolutely crack down on those who have been swollen with arrogance," Xinhua quoted the president as saying.
Witnesses said that the men, who were mostly dressed in black, attacked people at random.
A survivor named Yang Haifei, who was wounded in the back and chest, told Xinhua he had been buying a train ticket when the attackers rushed into the station.
"I saw a person come straight at me with a long knife and I ran away with everyone," he said.
He added that those too slow to flee were cut down.
Some who escaped were desperately looking for missing loved ones.
Yang Ziqing told Xinhua she and her husband had been waiting for a train to Shanghai "when a knife-wielding man suddenly came at them".
"I can't find my husband, and his phone went unanswered,"  she said.
Social media users in China posted pictures of the attack on the internet, but correspondents say they are being taken down.
Images seen by the BBC show men and women lying on the floor in pools of blood following the attack.
Kunming officials, quoted by Xinhua, later said that evidence at the scene showed it was "a terrorist attack carried out by Xinjiang separatist forces".
Xinjiang is home to the Muslim Uighur minority group which has a long history of discord with Chinese authorities.
State broadcaster CCTV said top security official Meng Jianzhu would travel to Kunming to oversee the handling of the investigation.

They were named as Robert Roche, 36, from Hove, Sussex, a boy aged three and a girl aged 18 months.
They set off from their home at 09:00 BST to go to a day nursery in nearby Holland Road but did not arrive.
Police were called at 17:30 when family members realised that they had not returned home.
Mr Roche is described as white, 5ft 10in (1.78m), stocky, with dark hair.
His children are three-year-old Joey and 18-month-old Betsy, who was in a very distinctive black "Bugaboo donkey stroller" buggy with a pink hood. There is also a step and a "saddle" by the handle bar.
Det Insp Mick Jones from Sussex Police said: "We are searching the local area and are keen to hear from anyone who has spotted Robert and his children.
"If you see them or know where they might be, please let us know right away on 101 or 999, quoting serial 1053 of 14/08.
"We also ask Robert to get in touch with us so that we can arrange to meet and confirm that he and the children are ok.
"We are not treating the disappearance as suspicious at this stage but it has not happened before and we are naturally very concerned for Robert and especially for his children."
An attack by knife-wielding men at a railway station in Kunming in south-west China has left at least 29 dead, the state news agency Xinhua says.
[NEXT_CONCEPT]
Police and family are concerned for the welfare of a man and his two small children who have not been seen since Monday morning.