A statement said the UNHCR spokesman, Charlie Yaxley, made the condemnation at a news conference.
At least four people were killed while more than 100 people descended onto the Soweto area of Johannesburg to loot property and shops belonging to foreigners.
“The UN Refugee Agency is extremely concerned at recent xenophobic violence in South Africa.
“Those targeted included refugees and asylum-seekers – UNHCR is calling on the authorities to ensure that those responsible for acts of violence and violations of human rights are brought to account,” Yaxley said.
The agency stressed that all possible efforts should be taken by the authorities to prevent attacks on foreigners in the future.
The UNHCR emphasised that such xenophobic violence might lead to further damage and destruction of property across the country.
Over recent months, South Africa has been facing a rise in violence against foreigners, the majority of whom come from Nigeria, Somalia and other African states.
Protesters often target small shops run by migrants, claiming that they are stealing scarce jobs from South Africans and are responsible for the country’s high crime rates.