President Jacob Zuma on Monday hit out at other African countries after South Africa faced a backlash over the wave of anti-foreigner attacks in the country.
"As much as we can have a problem alleged to be xenophobic, our brother countries contributed to this," he said.While Zuma condemned the violence, saying immigrants contributed to the South African economy, he also questioned why so many had flocked to South Africa.
"Why are the citizens not in their countries?"
Earlier in April, mobs in Johannesburg and in the port city of Durban targeted migrants, ransacking their homes and burning shops.
Seven people died and thousands were displaced.
South Africa faced a backlash over the attacks and regional relations have been strained, with Zimbabwe, Malawi and Mozambique organising for some of their fearful citizens to return home.
Nigeria has also recalled its ambassador in Pretoria over the attacks while there have been widespread calls for South African products to be boycotted.
But Zuma went on a counter-offensive Monday, saying his government would strengthen measures to tackle illegal immigration.
"Some of them (immigrants) had very serious allegations against their own countries to explain why they are in South Africa," Zuma said, speaking on Freedom Day that marks the country's first democratic elections in 1994.
"In fact, some of them warned us that there is almost certainly another wave of refugees coming given the developments in their own countries.
"We have to address the underlying causes of the violence and tensions, which is the legacy of poverty, unemployment and inequality in our country and our continent and the competition for limited resources," Zuma said.
Many South Africans have blamed the attacks on poverty and a severe jobs shortage in Africa's second biggest economy. Undocumented immigrants are often accused of accepting work for less pay.
The spate of attacks has revived memories of xenophobic bloodshed in 2008, when 62 people were killed, tarnishing South Africa's post-apartheid image as a "rainbow nation" of different groups living in harmony.
The South African army was deployed in some of the worst hit areas last week in a bid to crack down on the violence against immigrants.