The violence erupted after a foreign shopkeeper shot dead a teenager who had tried to rob him on Monday night.
"Young boys wanted to rob a shop and the owner opened fire and killed one of them," police spokesman Kay Makhubela told AFP. "That made the community angry, and that´s what started all this."
At least 80 shops, most of them owned by Somalis and Pakistanis, have been looted over the past three days, the police said.
A second person was killed on Wednesday night, and police said they were still investigating the circumstances.
Amid widespread poverty and unemployment, frustration in Johannesburg´s run-down neighbourhoods often boils over into anti-immigrant violence.
In 2008, deadly xenophobic violence broke out around Johannesburg townships, killing 62 people.