South African police fired tear gas, water cannon and rubber bullets to disperse rival marches by hundreds of citizens and non-nationals in the capital on Friday, following looting this week of stores believed to belong to immigrants.
Anti-immigrant violence has flared sporadically in South Africa against a background of near-record unemployment, with foreigners being accused of taking jobs from citizens and involvement in crime.
Armed police had formed a barrier between citizens and non-nationals marching in Pretoria, but the crowd became unruly with both sides shouting at one another prompting police to disperse the angry mobs.
Many shops were shuttered in Marabastad, an area situated in the west of capital, where many foreign nationals have their stores, and roads were blocked as the marchers gathered.
Some of the foreigners carried rocks and sticks, saying they were ready to protect their stores.
The marches follow the looting this week of at least 20 small businesses believed to belong to Nigerian and Pakistani immigrants in an area in west Pretoria.
Residents said they had attacked the shops because they were dens of prostitution and drug dealing.
President Jacob Zuma condemned acts of violence between citizens and non-nationals, his office said on Friday.
"It is wrong to brandish (sic) all non-nationals as drug dealers or human traffickers," Zuma said in a statement.
In retaliation, Nigerian protesters vandalised the head office of South African mobile phone giant MTN in Abuja.
Nigeria and South Africa, the continent's two largest economies and pre-eminent diplomatic and military powers, have a volatile relationship.