South African police deployed to head off unrest and protests on Tuesday, the unofficial deadline set by anti-immigrant groups for undocumented foreign nationals to leave that has already pushed thousands to flee.

Officers were out in force to prevent violence and looting by the xenophobic groups, while hundreds of foreign nationals took refuge in several cities, urgently seeking help to leave.

Most shops stayed shuttered and the streets of downtown Johannesburg were unusually quiet, with police fanning out across the city as commuters made their way to work.

The protests have been mobilised by a loose coalition of minor political parties and small citizen-led vigilante groups, which seem well organised and well resourced, analysts say, and have a strong presence on social media that includes disinformation debunked by AFP.

In the southeastern city of Durban, small groups of protesters in Zulu attire, carrying sticks and shields, gathered at a park, singing and chanting "abahambe", which means "Let them go" as security forces kept watch.