South African police have used rubber bullets, tear gas and water cannon to disperse crowds at an anti-immigrant march in the capital, Pretoria.
A low-flying police helicopter was deployed to break up a stand-off between local protesters and foreigners, with both groups armed with sticks, bricks and knives.
President Jacob Zuma said the protests were "anti-crime" not "anti-foreigner".
Many unemployed South Africans accuse migrants of taking their jobs.
Mr Zuma has condemned recent acts of violence and intimidation directed at African immigrants living in South Africa.
Earlier this week, angry mobs attacked Nigerians and looted shops belonging to Somalis, Pakistani and other migrants in townships around Pretoria and parts of Johannesburg.
"They [foreigners] should know that this they are a guest in my house. I am treating them with respect. They should treat me with respect," one angry protester told the BBC's Nomsa Maseko at the scene.
Nigerians in South Africa were "notorious" for dealing drugs, he added, calling for greater checks on foreigners coming into the country.
Somali and Bangladeshi immigrants in the western part of the city told the BBC that their shops had been looted during Friday's protests.
Shopkeeper Omar Adawi said it was the third time his business had been targeted: "I am not feeling happy... Now my shop is nothing. They took everything. I have lost everything. I have nothing left in my hands," he said.
The main group behind the Pretoria protests, Mamelodi Concerned Residents, has blamed foreign nationals for taking jobs and accused them of being involved in prostitution rings and drug cartels, accusations denied by immigrant communities.
The petition delivered by the group to the home affairs ministry alleged worshippers from Zimbabwean apostolic churches, who congregate in the open, were "destroying our public parks", and accused them of defecating, urinating and burning fires.
It also said foreigners were "arrogant and don't know how to talk to people, especially Nigerians".
But President Zuma said many foreign citizens living in South Africa were law-abiding and contributed to the economy.
"It is wrong to brandish all non-nationals as drug dealers or human traffickers. Let us isolate those who commit such crimes and work with government to have them arrested, without stereotyping and causing harm to innocent people," Mr Zuma said in a statement.
Speaking to media after the protest, the president denied that South Africans were xenophobic and that the event "was anti-crime in the main. It was not an anti-foreigners march."
"The number of foreigners in South Africa are far more than the numbers that Europe is fighting about... but nobody calls them xenophobic," he added.
The opposition Democratic Alliance (DA) blamed poor leadership for the unrest.
"The root cause of this rise in xenophobic violence is the ANC government's failure to create jobs and to equip our people with the necessary quality education and skills to gain employment," the DA said in a statement.
The home affairs minister announced plans on Thursday to inspect workplaces to see if firms are employing undocumented foreigners.
Police in Pretoria say they have made more than a hundred arrests in the past 24 hours, amid the unrest.
'March of hatred'
In a statement, they blamed a group from the Atteridgeville township in Pretoria, who were not part of the sanctioned protest, for this morning's violence.
The foundation of late South African leader Nelson Mandela says it was shocked at the decision by police to give the go-ahead for Friday's anti-foreigner protest, calling it "a march of hatred".
Official government figures say the number of immigrants in South Africa has declined in recent years.
Figures released last year said there were 1.6 million foreign-born people in the country, down from 2.2 million in 2011.
South Africa experienced its worst outbreak of violence against foreigners in 2008, when more than 60 people died.
Two years ago, similar xenophobic unrest in the cities of Johannesburg and Durban claimed seven lives as African immigrants were hunted down and attacked by gangs.