South Africa on Sunday vowed to hunt down those behind a wave of attacks targeting immigrants, saying 307 people had been arrested over violence that has left at least seven people dead.

The government stepped up its response to unrest in Johannesburg and the eastern coastal city of Durban, with Home Minister Malusi Gigaba resolving to end “all acts that seek to plunge our country into anarchy“.

Rioting and looting over the last two weeks have exposed tensions between South Africans and immigrants from across the continent, including Zimbabwe, Somalia, Ethiopia and Malawi.

President Jacob Zuma on Saturday cancelled a state visit to Indonesia to deal with surge in violence, and pleaded with foreigners to stay in South Africa.

Heightening public concern over the attacks, the Sunday Times published front-page pictures of a Mozambican man being stabbed to death in broad daylight in the Johannesburg township of Alexandra.

The photographs showed Emmanuel Sithole being attacked early Saturday by a man in jeans wielding a knife.

Sithole was taken to hospital but died of his wounds, the paper reported.

“Perpetrators are being arrested, charged and prosecuted,” Gigaba told a press conference in Pretoria.

“So far 307 suspects have been arrested in connection with attacks on foreign nationals and public violence.

“We want to issue a stern warning to those who lend themselves to acts of public violence. We will find you — and you will be dealt with to the full might of the law.” Sporadic violence erupted again overnight in Johannesburg and Durban, where an AFP photographer said that one Zimbabwean’s house had been petrol-bombed and his two cars torched.

The spate of attacks has revived memories of xenophobic bloodshed in 2008, when 62 people were killed in Johannesburg’s townships, shaking South Africa’s post-apartheid image as a “rainbow nation” of different ethnic groups.

Immigrants are often the focus for anger among South Africans hit by a chronic job shortage and the limited progress made by many poor blacks since white-minority rule ended in 1994.

Regional relations have been strained by the unrest, with Zimbabwe, Malawi and Mozambique organising for some worried citizens to return home.

Buses to Malawi were due to leave on Sunday, and Zimbabwe said about 700 citizens were expected to be ferried out by bus within days.

Zimbabwe has about one million mostly-illegal immigrants in South Africa, many of them working in the service sector, on construction sites and as casual labour. The UN High Commissioner for Refugees said most victims of the xenophobic attacks were refugees forced to leave their own countries due to war and persecution.

It said 5,000 migrants had sought refuge in makeshift camps, but local authorities said the figure was lower.

Zuma on Saturday travelled to Durban to visit one camp, where he faced a hostile reception from the crowd, which yelled “go home, go home” and “too late, too late“.

He vowed to end the unrest and sought to assure the crowd there was a place for foreigners in South Africa.

“Even those who want to go home, they must know that when we have stopped the violence they are welcome to come back,” Zuma said.

The violence has been largely blamed on a speech last month by King Goodwill Zwelithini, traditional leader of the Zulus, in which he blamed foreigners for South Africa’s high crime rate and said they must “take their bags and go“.

He has since said his words were misinterpreted.

South Africa’s economy grew by just 1.5% last year and unemployment is at around 25% — soaring to over 50% among young people.

Gigaba stressed that foreign companies were still welcome to invest in South Africa.

“Everything is being done to restore peace and order,” he said.