Five Mozambicans were killed in "xenophobic attacks" in South Africa at the weekend, the Mozambican government said, in the first deaths officially linked to protests against illegal migrants sweeping the country.

Around 800 Mozambican nationals were caught up in the violence that broke out in the southern coastal city of Mossel Bay on Friday, the government press office said in a statement received on Tuesday.

"Regrettably, seven Mozambican citizens have died, five of them as a direct consequence of the xenophobic attacks and the other two as a result of a road accident, when they were travelling in a private vehicle on their way back to Mozambique," said the statement.

The violence prompted 300 Mozambicans to return to their country by their own means on Saturday, said the statement, issued late Monday.

"The remaining just over 500 have since been sheltered in a safe location in the Western Cape Province, and as of today, 1 June, the process of their repatriation to Mozambique is already underway," it said.