President Cyril Ramaphosa has repeated his disapproval over widespread attacks on foreign nationals since the weekend, saying they are "not justified".
Speaking at a Brand SA breakfast meeting in Cape Town on Wednesday morning, Ramaphosa first spoke out against the most recent violent murders of Uyinene Mrwetyana and Leighandre Jegels.
He asked attendees to rise as a show of respect, before saying: "The nation is in deep mourning."
Ramaphosa then turned his attention to xenophobic violence.
Ramaphosa had initially received widespread criticism for his silence on these issues. On Tuesday, the hashtag #DearMrPresident was trending on Twitter, with people questioning why Ramaphosa had remained silent as the violence continued.
Democratic Alliance (DA) leader Mmusi Maimane called on Ramaphosa to "come out of hiding" in the midst of serious violent crimes, protests and what he called an "economic collapse".
The president ultimately responded in a video posted on Twitter on Tuesday afternoon, stating: "I condemn the violence that has been spreading around a number of our provinces in the strongest terms. I'm convening the ministers in the security cluster today to make sure that we keep a close eye on these acts of wanton violence and find ways of stopping them."
On Wednesday, Ramaphosa elaborated on the issue.
"We are facing another huge challenge," Ramaphosa told delegates, "the challenge of a number of our people taking the law into their own hands."
"As much as they have certain grievances, taking action against people from other nations is not justified and should never be allowed in our beautiful country. South Africa is a home for all."
Ramaphosa said South Africa was not the only African country that had become a home for people fleeing from their home nations.
"We know that there are quite a number of foreign people who come to our country and we should make sure that we live side by side with them.
"If there are problems and challenges, we should be able to find ways to address those. Whether it is problems of criminality...does not mean we should take the law into our own hands and attack those people."
Ramaphosa commended the police for the arrests that have been made in relation to xenophobic attacks.
South Africa has been hit by an outbreak of xenophobic violence in Gauteng, attracting criticism from other African nations in the same week that political and business leaders from at least 28 countries have gathered in Cape Town.
A spate of violence that broke out in suburbs south of Johannesburg's city centre on Sunday, which spread to the central business district on Monday, saw the destruction of more than 50 mainly foreign-owned shops and business premises. Cars and properties were torched and widespread looting took place.
The attacks have come ahead of the 28th World Economic Forum on Africa, in Cape Town on Wednesday, and before a state visit to South Africa next month by President Muhammadu Buhari from Nigeria, a country whose nationals have been affected.
On Tuesday, Buhari tweeted: "I am sending a Special Envoy to President Ramaphosa to share our deep concern about the security of Nigerian lives and property in South Africa... "