More than 130 people were wounded when knife-wielding attackers indiscriminately slashed at people queuing for tickets at the Kunming railway station in southern China late on Saturday.
Police shot dead four of the attackers.
“The South African government condemns all forms and manner of terrorism,” said international relations department spokesman Clayson Monyela.
“We believe that terrorism in any form and from whichever quarter cannot be condoned.”
Chinese authorities have blamed the attack on ethnic separatists from the far west.