President Jacob Zuma says the march against immigrants in Pretoria on Friday is evidence that citizens are fed up with crime.
Speaking after the launch of Operation Phakisa, which is aimed at boosting various sectors of the South African economy, he said the march included foreign nationals, was well organised and was not xenophobic.
"We do have a big problem. This time around this has been provoked by crime."
He said the media should be careful about labelling the protests as xenophobic. Political leaders must also be cautious with their messages.
Crime affects everyone and people are fed up, he said.
"If there are people who occupy houses and use them for crime this will make people angry. How do we fight crime?
"We must focus on drug lords and deal with them. Those are the gaps we need to close."
Whether South African or foreign, criminals should be dealt with using the proper channels, he said.
'Europe doesn't want immigrants'
A group calling itself the Mamelodi Concerned Residents organised the march to the Department of Home Affairs in Pretoria on Friday to protest the presence of immigrants in South Africa.
Police had to use stun grenades and rubber bullets to diffuse a tense stand-off between foreign nationals and South Africans in Marabastad.
A small clash between foreign shop owners and South African marchers also broke out in Christoffel Street. The police were quick to react and the fight was quelled.
Zuma urged South Africans to be understanding towards foreign nationals.
He questioned the idea that South Africans are xenophobic, saying if they were "this country wouldn't have this many immigrants".
He said only 5% of immigrants were refugees.
"The number of foreigners in South Africa is far more than in Europe. They don't want immigrants."
Zuma said he had met with his ministers to discuss what they could do to fight crime.
He would also be talking to the police.