South Africa was the "Rainbow Nation," the conqueror of the racist apartheid system, the land of Nelson Mandela and Archbishop Desmond Tutu, the economic hub of sub-Saharan Africa, a perennial candidate for a permanent U.N. Security Council seat, and the unanimous choice to be the first African nation to host soccer's World Cup in 2010.
But three weeks of violence, rioting and looting targeting poor, vulnerable immigrant communities have badly shaken South Africa and tarred its reputation abroad.
"These happenings have really dented the image of South Africa in a manner which people cannot imagine," Sbu Ndebele, premier of the KwaZulu-Natal province, told the South African Broadcasting Corp. in a radio interview.
Because the mobs targeted nationals from countries across southern Africa, the aftershocks of the attacks have been widely felt and condemned. Officials say at least 56 people were killed and 50,000 were displaced in the attacks, which have been reported in at least seven of the country's nine provinces.
The government of Zimbabwe - whose nationals make up the bulk of the victims in the violence - has offered aid to its citizens seeking to return home, as have Mozambique and Malawi. Nigerian Foreign Minister Ojo Maduekwe said Tuesday that his government will ask South Africa for monetary reparations for Nigerians hurt or displaced in the attacks.
The bloodshed has its roots in basic economics. Poor South Africans blame the African immigrants for taking jobs, depressing wages and sparking a national crime wave.
But the real long-term damage from this month's violence may be to South Africa's image as a regional power broker and the continent's moral compass, based on its size, prosperity and reputation as a symbol of racial harmony from the long struggle to end racial apartheid.
"The appalling hunting of foreigners, which stains the emblematic land of South Africa, must be lived as an unspeakable shame, a slap against the struggle of Mandela," the Senegalese newspaper Sud Quotidien said in an editorial last week.
Bishop Paul Verryn of Johannesburg's Central Meth-odist Church said, "We need to apologize to neighboring countries for how we have treated their citizens.
"At the moment, it is a disgrace to be a South African. A number of Germans must have felt the same during World War II," the bishop told the German magazine Der Spiegel.
South African leaders have moved to quell the violence and contain the damage to the country's image, with mixed success.
President Thabo Mbeki's May 25 "Africa Day" speech included an extended apology for the violence and a plea for South Africans to respect the rights of foreigners in the country.
"Never since the birth of our democracy have we witnessed such callousness," Mr. Mbeki said. "We must acknowledge the events of the past two weeks as an absolute disgrace."
Yet the government has also vigorously defended itself against attacks over its handling of the violence, from criticisms that it ignored long-smoldering ethnic tensions at home to charges that its low-key diplomacy regarding the economic and political crisis in neighboring Zimbabwe provided critical fuel for the violence at home.
The South African Embassy in Washington put out a lengthy statement defending Mr. Mbeki's handling of the Zimbabwe crisis and saying critics badly underestimated the region's long colonial history in today's crises.
"The 14 years of democracy in South Africa have been very successful in addressing our social challenges, in particular the socioeconomic situation in which many poor Africans live," the embassy said.
"However, what our government has achieved is nowhere nearly enough to undo centuries of economic oppression and exclusion based on racial subjugation."
South African Intelligence Minister Ronnie Kasrils told South African reporters that the government was aware of simmering anti-immigrant feeling and the potential for violence.
"It is one thing to know there is a social problem and another thing to know when that outburst will occur," he said.
But the opposition South African Democratic Alliance party has taken officials to task for what it called the government's failure to deal with the growing immigrant problem and its search for "excuses" for not heading off the violence earlier.
The sense of disillusionment is felt across the continent. Many Africans recalled that top figures of the African National Congress - now South Africa's governing party - found sanctuary in their countries in the long struggle against the apartheid regime.
The recent violence "is a disgrace and in total contradiction with the traditional culture where brothers and sisters help each other communally in times of need," according to a letter writer to 7Days, a United Arab Emirates-based newspaper.