South Africa's parliament will be suspended from next week to enable politicians to return to their constituencies to spread the anti-xenophobia message, in the wake of deadly attacks on African migrants.

The move is the latest in a series of government initiatives aimed at quelling weeks of violence against foreigners, which has left at least seven dead and driven thousands from their homes.

"We can't carry on at Parliament like it is business as usual," National Assembly speaker Baleka Mbete said, adding that lawmakers were being released to take part in "appropriate" activities.

A statement issued by the parliament stressed the need for tolerance.

"Parliament adds its voice to the all-round condemnation of violence against foreign nationals, racism and forms of intolerance in our country," it said.

"The dignity and respect we should give to all people was shown to us many times over by particularly the people of Africa during our own struggle for non-racialism, non-sexism, freedom and human rights," it added.

Thousands of people in Johannesburg have taken part in protests and candlelight vigils as a mark of respect for those who died, were injured or were driven from their homes following the recent spell of xenophobia attacks. 

Today President Jacob Zuma - who has also condemned the violence - is due to meet leaders of organisations representing foreign nationals living in South Africa.

He has pledged to tackle anti-migrant sentiment and to address deep-rooted problems behind the attacks.

More than 20 years after the end of apartheid, however, high unemployment and a lack of opportunities for young black people have made impoverished and crowded townships a powder-keg of frustration.

Immigrants have found themselves being blamed for taking jobs from locals and high crime rates.

Soldiers were deployed in Johannesburg this week to aid police in raids on hostels housing South African men who are accused of targeting migrants from Zimbabwe, Malawi, Mozambique and other African countries.

The violence has brought condemnation from the governments of those countries, which have pushed home thousands of their nationals who fled the attacks.

The unrest has also been widely condemned in South Africa itself, with large turnouts at anti-xenophobia rallies in cities across the country.