PRETORIA (Reuters) – 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-South African protesters are seen gathered at the Foreign Affairs Ministry in Abuja, Nigeria February 23, 2017. REUTERS/Afolabi Sotunde

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.

A local security staff member places a notice on the wall after anti-South African protesters attacked the MTN office in Abuja, Nigeria February 23, 2017. REUTERS/Afolabi Sotunde

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.

President Jacob Zuma arrives ahead of his State of the Nation Address (SONA) to a joint sitting of the National Assembly and the National Council of Provinces in Cape Town, South Africa February 9, 2017. REUTERS/Sumaya Hisham

“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.

Security guards conduct checks after anti-South African protesters attacked the MTN office in Abuja, Nigeria February 23, 2017. REUTERS/Afolabi Sotunde

Nigeria and South Africa, the continent’s two largest economies and pre-eminent diplomatic and military powers, have a volatile relationship.

(Reporting by TJ Strydom; Writing by James Macharia; editing by Ralph Boulton)

Update: MTN has reportedly shut its offices in Nigeria.

MORE: No data shows that 800,000 Nigerians live in South Africa

Police fire rubber bullets to disperse crowds in Pretoria

The South African who was attacked says he didn’t know why they attacked him. “I was just standing their watching everything, like everyone else.”