President Cyril Ramaphosa says foreign nationals need to abide by the rules and laws of South Africa.
He was speaking at a meeting with ANC Johannesburg region branches on Sunday.
Ramphosa has dispatched a team of special envoys to deliver messages of solidarity to several African countries.
The team of envoys will brief governments about the steps South Africa is taking to end the violence.
Nigeria, Tanzania and Zambia are among the countries to be visited.
“In accordance with our protocol, our laws and regulations, one of the presidents of the African countries told me that they had a meeting just two weeks ago before the WEF with their own nationals, and when they had a meeting nationals had complaints,” said Ramaphosa.
“Whilst we understand why our nationals are feeling unsafe, that president also said, you just imagine if you were to have south Africans in your country who do not obey the law, who embark in criminal activity, how would that affect you. They immediately realised indeed the issue of living in accordance with the law of the country is what should be expected from every national,” he said.
Ramaphosa was also one of a dozen African leaders who attended former Zimbabwean President Robert Mugabe’s funeral in Harare on Saturday.
South Africa has been rocked by a surge of deadly attacks against foreigners. At least 12 people have been killed in the violence and hundreds of shops destroyed.