What was it that led to around 100,000 foreigners being driven from homes in South Africa?
One factor could be rising anger at allegations that foreigners have corruptly been given subsidised housing.
At first South Africa's Minister of Intelligence Ronnie Kasrils said that some kind of subversive "Third Force" was behind the attacks.
"We are not just seeing spontaneous xenophobic attacks," he said during a tour of the worst affected areas.
"There are many social issues at the root of the problem, but we have reason to believe that there are many other organisations involved in sparking the attacks," he added.
But later he withdrew the accusation, saying: "I accept that we have had a spontaneous outburst of xenophobia here."
So what really caused the attacks?
With the violence having been perpetrated across such vast areas of the country, there is no simple answer.
But one source of tension has been intense competition for the subsidised housing built by the government under its Reconstruction and Development Programme (RDP).
The problem with the RDP housing is that although the government now builds over 180,000 units a year, there are never enough.
They are allocated not by municipalities or officials, but by the locally elected councillors.
Bribery and corruption
For a number of years now this has led to allegations that they take bribes in return for housing and this has led to many protests.
In 2005, for example, residents in the town of Musina, close to the border with Zimbabwe, marched on the municipality to protest about the lack of action against certain councillors accused of giving houses to foreigners for money.
Sinkie Makushu, chairman of the Greater Musina Unemployment Forum complained that they had provided ample evidence of corruption, but that no action was taken.
"The police have every bit of information regarding corruption at the municipality, but they keep saying they are still investigating," he said.
The previous year angry residents chased about 50 people out of RDP houses after claims that they were foreigners, who were paying rent or had bought the homes outright from local councillors.
Some of those evicted from the RDP houses produced bank receipts proving they were paying rent of 50 rand ($6.5) or more to some councillors. Other occupants said they had bought the houses for 6,500 rand ($850) each.
Anger at the allocation of housing in return for payments has been seen in several places during the xenophobic attacks carried out over the past two weeks.
People living in Alexandra, on the outskirts of Johannesburg where the violence originated, said foreigners had jumped the low-cost housing allocation lists by paying bribes.
The housing department in the Gauteng region which surrounds Johannesburg said it had allocated nine houses to foreigners in Alexandra but argued in a report that those people had permanent resident permits.
The opposition Democratic Alliance said the government needed to clarify its housing policy and explain who qualified for state-owned houses.
Since most councillors are members of the African National Congress, it is the party that has been blamed.
The problems were acknowledged by ANC Secretary General Gwede Mantashe.
"Many people have taken occupation of more than one RDP house and sell their houses instead of living in them. We must put a stop to this practice and expose all who are corrupt," he wrote on the party's website.
A similar point was made by the leader of the ANC's ally, the South African Communist Party.
"Some of our own councillors illegally take bribes and allocate RDP houses to undeserving people who are South African and non-South African citizens," said Blade Nzimande, the SACP's general secretary.
"These corrupt practices create fertile ground for intra-community conflict and xenophobia," he said.
The government has attempted to deal with this issue.
Recently the department of housing said that more than 7,000 civil servants have acquired RDP houses illegally.
"We have 7,363 pending cases of fraudulently acquired RDP houses by government officials throughout the country," says Simphiwe Damane-Mkhosana, head of an anti-corruption unit in the housing department.
"We intend to prosecute all the individuals who benefited."
But the practice has become so widespread that rooting it out is proving difficult.
The resulting tensions have only served to exacerbate differences between South Africans and foreigners living in the so-called Rainbow Nation.