After meeting business, civil and religious leaders, Zuma said his government would take decisive steps to address "underlying" problems behind the attacks and ensure foreigners were not targeted.
"South Africans are not xenophobic," he said. "If we don't deal with the underlying issues, it will come back."
"We have taken a decision that we don't want to see it again and therefore we are going to be working together with that determination."
Zuma gave few details of government plans, but said the violence was driven by "criminal elements" as well as friction between foreigners and locals.
Many South Africans believe poverty and a severe jobs shortage is one driving factor behind mobs in Johannesburg and Durban targeting migrants from Zimbabwe, Malawi, Mozambique and other African countries.
The spate of attacks has revived memories of xenophobic bloodshed in 2008, when 62 people were killed, tarnishing South Africa's post-apartheid image as a "rainbow nation".
The SANDF was deployed to restore order in the 2008 unrest, and was also used against violent strikers in 2012.
'Police are overwhelmed'
Deputy general secretary of the ANC, Jessie Duarte, said the targeting of migrants was "well organised and co-ordinated" and that the army would only play a supporting role in preventing unrest.
"The army is there to assist the police [and] to ensure police are able to conduct searches," she told a press conference on Wednesday.
"The issue we have here is poverty, inequality and unemployment - it is huge for us."
Bene M'Poko, the Democratic Republic of Congo ambassador, told reporters at the event that the three weeks of violence threatened South Africa's reputation for tolerance.
"This is a sad day for South Africa... and also for the continent," he said.
"The deployment of the army indicated that police are overwhelmed," he added, accusing police of being slow to react.
"We in the diplomatic community wondered, where [are] the riot police?"
Late Tuesday, dozens of soldiers surrounded the workers' hostel in Jeppestown that has been a hotspot for xenophobic clashes, and police stormed inside.
As a helicopter hovered overhead, officers moved from floor to floor conducting searches as residents lay face down in corridors.
"Eleven suspects were arrested in Jeppe hostel for possession of dagga and stolen property. They were aged between 24 and 49," police spokesperson Solomon Makgale said.
'Soldiers are trained to kill'
The involvement of soldiers was criticised by the EFF as a overreaction and a misuse of the military.
"[The] government is losing control over society and now resorting to extreme measures in the same manner done by the apartheid regime," it said.
"Soldiers and armies all over the world are trained to kill, and we will not be shocked when instead of keeping peace in the townships, there are casualties."
A mass anti-xenophobia march is planned in Johannesburg on Thursday, and Zuma is due to hold talks with groups representing foreign nationals living in South Africa on Friday.
Regional relations have been strained by the attacks, with Zimbabwe, Malawi and Mozambique organising for some worried citizens to return home.
Neighbouring Mozambique said more than 2 000 citizens had fled the violence.
Five buses also arrived back in Zimbabwe on Wednesday.
"I don't know what to do next," said Wonder Nyamutowa, who worked as a construction worker in Durban.
"I am a breadwinner and I could manage to send money back to my family, but I won't go back."