"Never since the birth of our democracy have we witnessed such callousness. We must view the events of the past two weeks as an absolute disgrace," he said in his first public address since the outbreak of violence on May 11.
Mbeki's government has faced calls to take steps to quell waves of refugees and asylum seekers from other African countries, such as Zimbabweans running an economic meltdown back home or Somalis fleeing from a near-civil war.
Attacks on immigrants have spread to seven of South Africa's nine provinces, forcing many to flee back to their homelands.
Some poor South Africans blame the foreigners for the country's high crime rate and unemployment levels. Recent rises in food and fuel prices have pushed tensions to breaking point.
But Mbeki, speaking on the UN's Africa Day, urged citizens to be charitable to foreigners and said the country's prosperity was linked to that of the rest of Africa.
"We must remain firm in our commitment to work hard to achieve the goal of the renewal of our continent, understanding that in this circumstance an injury to one is an injury to all," Mbeki said, vowing to resist calls to force migrants into camps.
Hundreds of South Africans marched through Johannesburg, the country's largest city, a day earlier to show their support for immigrants.
Demonstrators, some carrying placards that read "Xenophobia hurts like apartheid" and "We stand against xenophobia", brought traffic to a standstill in the city's business district on Saturday.
Police have arrested more than 500 people in connection with the attacks.
Mbeki deployed the army to assist on Thursday - the first time since the end of apartheid in 1994 - after a request from the police.
African Union officials have expressed shock at the attacks in Africa's most developed nation.