Hundreds of anti-migrant protesters marched through a township outside Johannesburg on Monday, a day after South African President Cyril Ramaphosa pledged action against groups accused of fuelling xenophobic violence.

South Africa has seen recurring bouts of anti-migrant violence, with protests intensifying this year after vigilante groups ordered undocumented foreigners to leave by June 30.

Chanting and singing as they moved through Kwa-Thema, a township about 40 kilometres southeast of Johannesburg, protesters called for tougher government action against illegal immigration.

"We want the government to implement the laws and go and build a wall on the border. Stop these people from flocking into the country. That is simple," said lead campaigner Nkosikhona Phakel'umthakathi Ndabandaba.

The march was peaceful even though some participants carrying sticks and others waved placards reading "Go home."