In late 2000, a horrific video surfaced in South Africa showing six white policemen setting dogs on and punching and kicking three black Mozambican illegal immigrants.

In the appalling images flashed around the world, the defenceless victims were shown screaming in agony as the German Shepherds savaged them and the uniformed tormentors laughed hideously.

The incident led to furore in the country. Black South Africans took to the streets in protest and the accused policemen had to be brought to court in armoured personnel carriers for their own safety.

Fast forward eight years and there is a similar public outcry now as at least 62 immigrants from African countries — chiefly Zimbabwe, Mozambique, Somalia and Nigeria — have been murdered by roving gangs of South Africans in townships outside Johannesburg, Durban and Cape Town.

Only this time, it is black against black. Over 300 have been wounded and at least 25,000 have taken shelter in police stations and churches as their shacks in shantytowns have been smashed and their pitiful possessions looted.

While President Thabo Mbeki has termed the bloodletting an “absolute disgrace” and people have been coming forth with food and blankets for the displaced, there is a need for soul-searching.

During the dark years of apartheid, the very countries these immigrants come from had extended considerable moral and logistical support to the African National Congress, which was then fighting the white regime in Pretoria.

Many of the ANC’s cadres were trained in Mozambique and Zimbabwe. Ordinary black South Africans got scholarships to study in Nigeria and other countries.

The support came despite the heavy-handed reprisals by the apartheid state, including aerial bombing raids and, in the case of Namibia and Mozambique, ground attacks that destabilised these countries.

The apartheid regime started implementing in southern Africa the model provided by its close friend, Israel, in the Middle East.

Just as Israel punished Palestinian resistance in the Occupied Territories in the 1980s with attacks on the fighters and civilians in Lebanon and Tunisia, the white regime carried out reprisals against countries such as Mozambique and Zambia.

There were similarities between South Africa’s aerial bombardment of the Mozambican capital Maputo in 1983 and the Israeli attack on Beirut a year earlier.

Citizens of African countries that helped the ANC during its struggle against apartheid now point out the sacrifices they made to help South African nationalists in the titanic struggle against the military might of the government.

After the recent attacks against black foreigners, they accuse (black) South Africans of being ungrateful to them.

While these sentiments are understandable, there are some internal dynamics at play in South Africa which must not be overlooked.

Speaking to Weekend Review, Len Leroux, Director of the Pretoria office of the Institute for Security Studies (ISS), said there were deep underlying reasons for the ferocity of the violence.

“If you look at the present situation [in the townships], you will find the problems of poverty and deprivation. You will see a lack of service delivery, and people living on promises from the government. There is inaction, especially at the local government level.”

Leroux said it was difficult to say what sparked the latest violence. “It could be increasing food prices … It could have been the housing crisis. Some South Africans illegally sublet their [government-provided] houses to foreign migrants.

"This gives the impression to other South Africans that the foreigners are getting housing from the government and they are not. The spark could have [arisen out of the] coming together of the food and housing crises. It is difficult to point [out] one particular cause.”

There is an ongoing battle within the ruling ANC — between Mbeki and party leader Jacob Zuma, Leroux said. “There is a sort of power vacuum. When the spark came, the initial response was slow. The government was in denial [mode]. No one in the government got on top of the issue."

"The problem is a lack of leadership. People at the top and the local [leaders] don’t take responsibility.” Leroux said the ongoing “unwise” restructuring of the security services was also to blame for the violence getting out of control.

The government, for its part, while recognising the need to provide jobs and fight poverty, has said that genuine concerns are being exploited by miscreants to justify the attacks on foreigners.

It has also said that it will set up special courts to try those accused of xenophobic attacks. Having drawn flak for what was seen as a slow and inefficient response, the government has, for the first time since the end of apartheid, sent the army into the townships to control the violence.

Despite being the richest and most developed country in Africa, South Africa is also a place of great inequality, with many millions living in squalor. Though the total unemployment figure is around 22 per cent, for the black majority it is 40 per cent.

Poor immigrants from African countries invariably end up in townships and shantytowns jostling for jobs, housing and resources with some of South Africa’s most underprivileged.

Most of these migrants, especially the Zimbabweans, tend to be much better educated and much more eager to work than their South African counterparts. Even employers find them more desirable as they are cheaper to hire and work harder.

They can also be easily “kept under control”, as most have no legal papers entitling them to work in the country. This situation has led to further resentment in a population which has not seen a change in its fortunes 14 years after the country became a multi-racial democracy.

Eric Pelser, Executive Director of the Cape Town-based Centre for Justice and Crime Prevention (CJCP), told Weekend Review that many observers had seen the violence coming.

“These incidents are not new; there have been many such incidents before. Last year, between 50 and 60 Somali immigrants were killed in attacks across the Eastern and Western Cape provinces. It is partly a failure of the state to analyse this. But this time the scale of the attacks was much bigger.”

Pelser believes the problem was driven by issues such as resources. “The gangs must realise that foreigners are not taking their resources. The foreigners are just more entrepreneurial and hardworking.

"The Somalis, for example, have no idea of state [Somalia is seen by many as being a “failed state”]. So when they come here, they depend only on each other and organise themselves well.”

Asked if other Africans are right in feeling that South Africans have been “ungrateful”, Pelser said: “I think that is true only at the emotional and political level. In reality, it is at best partly true.

For instance, there were no ANC cadres undergoing training in a country such as Somalia. But Somalis have also been targeted. We must understand that this is a different generation.

I don’t buy the argument that the present generation of South Africans owes a debt of gratitude [to the African countries that helped in the country’s fight against apartheid]. This violence has nothing to do with that.

“Besides, the public reaction has been massive. Thousands have donated money and food, particularly in Cape Town. It took a while for the scale of the violence to sink in, but once it did, the people have responded magnanimously.”

But what explains the brutality of the recent killings? What explains the spectacle of cheering crowds as migrants were being slashed with machetes? What explains “necklacing” — putting a tyre filled with petrol around the neck of a person and setting it ablaze?

It is estimated that there are about 5 million immigrants in South Africa out of a total population of about 48 million. About 3 million are from Zimbabwe.

They are, of course, fleeing the violence of Robert Mugabe’s regime and the deprivation caused by the economic meltdown in the country, where inflation now stands at 165,000 per cent.

The other main reason for the xenophobia — as Zuma, the potential future president, rightly described — is the widespread belief that migrants are to be blamed for the country’s shocking crime rate (about 50 murders, 125 rapes and 700 burglaries a day). But this is a misconception which is not borne out by facts.

While foreigners are certainly involved in crime, the fact remains that South Africans account for the majority of criminal incidents in the country.

“Xenophobia is a problem throughout Africa. During apartheid, black South Africans were cut off from the rest of the continent. Hence, they don’t really understand the rest of Africa,” Leroux, the ISS director, said. “What is encouraging is the strong response from civil society.”