South Africa was holding its breath on Tuesday as mass anti-immigration protests were held across the country. They come after a weeks-long campaign against foreigners that has seen at least four killed and tens of thousands fleeing for safety. In the coastal city of Durban, where violence had been expected, the streets were unusually quiet and shops were shuttered as tension hung thick in the air.

Several thousand protesters in Zulu attire marched through the city centre, brandishing sticks and clubs and calling out “Abahambe!” (“They must go!” in isiZulu, the most widely spoken language in the country), a phrase that has become the movement’s rallying cry. Campaign groups behind the protests have given undocumented immigrants an arbitrary “deadline” of 30 June to leave the country, with many fearing the marches could descend into violence. In the days leading up to the deadline, thousands of people have fled their homes in fear, sleeping rough on pavements, in open fields and in makeshift camps, in the hope of being repatriated to their home countries.

Several African governments have organised buses or planes to bring their citizens home, with police saying more than 25,000 have been repatriated so far. In the city of Pietermaritzburg, 50 miles from Durban, where a 29-year-old Malawian national was killed by a mob after a protest on 19 June, hundreds of families camped for days outside an abandoned building. On the eve of the 30 June protests, as authorities raced to send home as many as possible, a queue snaked through the overgrown garden.

Weary mothers and children sat around campfires while people lifted their tightly packed belongings into buses headed for South Africa’s northern border. Jackson Makungwa stood in the line beside two small bags: everything he could carry from 10 years spent building a life in South Africa. The 29-year-old from Malawi had once seen South Africa as a “country of hope” and had lived there legally, but said he had been unable to renew his work permit for the past two years.

“It’s not like I want to be illegally in the country, but the system doesn’t allow me to be here legally,” he sighed. For weeks, Makungwa resisted his mother’s growing pleas for him to leave. That changed after a friend from Malawi was attacked by seven men.

“They said the deadline is the 30th, so they will attack me if I stay,” Makungwa said. On his phone, he showed a photo of his son, born to a South African mother. He hadn’t managed to secure travel documents for the baby in time.

“I was forced to leave him behind. He turns two months old today.” Down the road, in a makeshift camp set up by families from Zimbabwe, Lydia Mpingashato had just been informed of her dismissal from her job as a cleaner. Children ran around as women cooked on open fires.

Many – including people with legal documentation – said they had been evicted by landlords who feared retaliation for renting to immigrants. On 27 June, Mpingashato was threatened while waiting for a shared taxi in the township where she had lived for 17 years. “He said he would burn my house and kill my family,” she said.

“Now I have no plan; I’m just going home to be safe.” Her 17-year-old son had been forced to leave the only home he had ever known, as well as many South African friends, she said.