South Africa says it will launch an "early warning" system with Nigeria to track and deter xenophobic attacks following a surge in violence in the rainbow nation.

South Africa's Foreign Minister Maite Nkoana-Mashabane said the new monitor would "help prevent violence" against foreigners and their businesses as she met with Geoffrey Onyeama, her Nigerian counterpart on Monday.

Last month, more than 20 shops were targeted in Atteridgeville, 120km west of Pretoria, while in Rosettenville, an area south of the commercial capital Johannesburg, residents attacked at least 12 houses.

In response to the violence, the Nigerian government called for the African Union to step in and stop the "xenophobic attacks", claiming 20 Nigerians were killed in South Africa last year.

South African authorities have declined to confirm the figure, which may have been the result of other criminal activity, not just anti-immigrant violence.

Nkoana-Mashabane told reporters it was untrue that the attacks were specifically "targeting Nigerians", adding that citizens of other countries were also affected.

She said the monitor would meet every three months and would be made up of representatives from both countries including immigration officials, business associations, and civil society groups.

'Mass attacks'

Onyeama said he had received assurances that Nigerians in South Africa would be able to live in peace and called for an end to "mass attacks".

According to the Nigerian Union in South Africa, there are about 800,000 Nigerians in the country, many of them living in Johannesburg.

A protest march against "migrant crime" was held in Pretoria on February 24 and resulted in violent clashes between crowds of young South African men and migrants from elsewhere in Africa, including Nigerians and Somalis.

Attacks against foreigners and foreign-run businesses have erupted regularly in recent years in South Africa, fuelled by the country's high unemployment and poverty levels.

President Jacob Zuma called for calm and restraint, saying that migrants should not be used as a scapegoat for the country's widespread crime problem.