China's president, Xi Jinping, has called for "all-out efforts" to bring to justice the black-clad assailants who killed 29 people with knives and machetes in a bloody terrorist attack in the south-western city of Kunming on Saturday night.

Officials blamed Xinjiang separatists for the frenzied violence at a crowded train station. Witnesses described fleeing in fear as the assailants hacked at people apparently at random. Graphic photographs of the aftermath showed bodies lying in pools of blood.

One of the 130 survivors injured in the incident described fleeing in terror as a man lashed out with a long knife, nicking his scalp. "I was terrified … they attacked us like crazy swordsmen, and mostly they went for the head and the shoulders, those parts of the body to kill," 20-year-old student Wu Yuheng told Reuters as he lay on a bed in a corridor of the Kunming Number One People's hospital.

Xi urged security officials to "severely punish in accordance with the law the violent terrorists and resolutely crack down on those who have been swollen with arrogance," state news agency Xinhua said. He added: "Understand the serious and complex nature of combating terrorism … Go all out to maintain social stability."

It is the first time people from the north-western region have been accused of such a major and organised attack outside its borders, despite rising unrest there in recent years. Many of its Uighur ethnic group, who are Muslim and Turkic-speaking, chafe at Chinese policies and a smaller number want an independent state.

A doctor at the hospital described a scene of bedlam as scores of the seriously injured arrived. He told the Guardian the attackers appeared to be well trained because many of the cuts directly targeted internal organs. He said police were stationed in patients' rooms and doctors had been shown a notice ordering them not to divulge information on the injured, including their condition and how many there were. They were told to tell families the government would arrange compensation.

They were also told that police had set up checkpoints on every route out of the city to ensure suspects could not leave.

Police outside Kunming railway station after the knife attack. Photograph: AP

Armed police patrolled the tense city on Sunday night as officers continued their hunt for five of the 10 assailants. They shot four attackers dead at the scene, three men and one woman, and captured a female suspect, Xinhua reported. Evidence at the scene of the "organised, premeditated violent terrorist attack" showed separatists were responsible, it said, citing the Kunming government.

Magnus Ranstorp, a counter-terrorism expert at the Swedish National Defence College, noted that little information was available at present but said that if Uighurs were responsible, "it is without question an escalation … There hasn't been anything on this scale, as far as I have seen."

The authorities have consistently blamed outbreaks of violence on a small number of separatists seeking an independent Xinjiang, working with the support or at the instigation of people outside the country. They reject suggestions that the unrest is fuelled by discontent at government policies rather than by an organised terrorist network.

On Sunday night, 24 hours after the violence, people gathered at a vigil outside the station, where candles in cups had been laid out to form a heart shape and the date of the attack. One man in the crowd told his friends: "If I had come here two hours earlier, I would have been part of this."

Close by, luggage dropped by people as they fled had been piled up on the area outside the station, apparently tagged as evidence. The heavy security presence included plainclothes officers with earpieces as well as police with machine guns and on motorbikes. Police vehicles lined the road.

AP reported police were rounding up members of the city's small Uighur community, thought to number at most several dozen, for questioning about the attack. "How do we know them?" said a Uighur man who gave only his first name, Akpar. "We could not tell if the assailants were Uighurs as they were all dressed in black. We did not like the attack either."

Mr Zhang, a businessman who was in Kunming for work, told the Guardian he was at a nearby hotel when a woman ran out of the station waiting area screaming that a crazy person was stabbing people. "Then people began to scatter, running in all directions – over 100 people," he said. "A man was stabbed and fell down and got up again."

Sixteen-year-old student Qiao Yunao told Associated Press she saw people crying out and running before an attacker cut a man's neck. "I was freaking out, and ran to a fast food store, and many people were running in there to take refuge," she said via the Sina Weibo microblog. "I saw two attackers, both men, one with a watermelon knife and the other with a fruit knife. They were running and chopping whoever they could."

Mr Wang, who works at a convenience store close to the station, said he saw police chasing a crowd of people to the street corner. "I heard gunshots and saw a man collapse. I couldn't watch after that. The police rounded up people and put them on a bus."

Security in Beijing had already been tightened because the annual session of China's largely rubber-stamp parliament opens in the capital on Wednesday, with another political meeting taking place on Monday. Officials have been particularly anxious about the safety of the capital since a car ploughed into tourists in Tiananmen Square, its political heart, last October. Two pedestrians, the driver and two passengers died in an incident also blamed on extremists from Xinjiang.

At least 100 people have died in outbreaks of violence in the region in the last year. Last month, police killed eight people they said had attacked patrol cars in Xinjiang. In 2009, almost 200 died in vicious ethnic riots in its capital, Ürümqi.

Many in the region's Uighur ethnic minority chafe at Han Chinese migration and controls on their religion and culture, which they believe are eroding their way of life. But Kunming, the capital of Yunnan province, is hundreds of miles from Xinjiang. In July 2008, just before the Olympics, a Uighur separatist group claimed responsibility for two bus explosions in the city, but officials said there was no evidence of terrorism.

A commentary on the English website of the state newspaper Global Times described the attack as "China's 9/11", saying: "The latest attacks in Beijing and Kunming have clearly indicated a despicable trend that separatists are targeting civilians out of Xinjiang.

"It also showed a shift in their attack strategies from targeting symbols of the government, such as public security stations and police vehicles, to roadside civilians."

Xinhua quoted navy rear-admiral Yin Zhuo as saying: "The well planned attack was not an issue of [ethnicity] or religion, it was an issue of terrorism with links to terrorist forces out of the country."

Authorities have yet to reveal the identities of those captured, shot dead or on the run, or give evidence of their motivation."They are holding that back and I think they are doing that because of the danger of stoking Han nationalism and resentment. This fear and hatred runs quite deep," said James Leibold, senior lecturer in politics and Asian studies at La Trobe University.

"The default position of the government has always been to blame foreigners and never admit that ethnic relations in China might have serious problems."