Audio By Carbonatix
People intending to protest against migrants should do so without "intimidation, threats or ultimatums", President Cyril Ramaphosa has warned on the eve of an unofficial deadline for undocumented foreigners to leave South Africa.
Several thousand citizens of other African countries have already left the country in recent weeks, fearing violence.
One undocumented Malawian told the BBC he was "happy to be going back" but "heartbroken" to be leaving behind four young children.
As protests have ramped up in recent months, Ramaphosa has repeatedly warned demonstrators to act peacefully and responsibly, while also accepting the need for immigration reforms.
"Some foreign nationals who live in South Africa are here lawfully," he reminded citizens in his weekly newsletter.
"They work, study, raise families, invest in our economy and contribute positively to our society. They too are entitled to the protection of our laws and our Constitution.
"The right to protest and freedom of expression does not allow people to threaten or intimidate others, or to engage in acts of vandalism or violence," he wrote.
There are more than three million documented foreign nationals in South Africa, according to official figures.
Ahead of the deadline, thousands of migrants have been awaiting processing in temporary camps for several weeks out of fear for their safety.
In Durban, which has seen some of the biggest protests, white tents housing mostly Malawians are being dismantled as authorities race to clear the transit camp.
Women in colourful sarongs sat on top of their belongings, waiting in line to board a bus home to Malawi.
One man, Nelson Mbewe, said he had gone to South Africa in search of employment to support his family in Malawi.
"But we've faced challenges - they're saying we should go back home because we do not have the right documents," he told the BBC.
"They say we are Makwerekwere" - a xenophobic slur used to refer to African migrants from other countries - Mbewe said.
"It's their country, so what can we do? That's why we have accepted that we just have to [unwillingly] go back home."
Hassan Phiri, a Malawian still awaiting processing, had a message for the protesters.
"All I want to say to South Africans is that we are all one. No matter what is happening, no matter what will happen, Africa must remain Africa.
"Africa can't be Africa without South Africa... without Malawi, without anywhere," he told the BBC, adding: "So whatever will happen, we must love each other and stick together as Africa."

Anti-migrant marches have been authorised for Tuesday in Durban, Johannesburg and other cities.
The authorities have warned organisers to ensure there is no violence but say they are prepared for any potential disruption.
The police say traditional weapons are not allowed. This could lead to tension between protesters and the police because many of the protesters are ethnic Zulus, who always take their shields, whips and sticks when they go on marches.
According to the government, more than 12,000 immigrants have been deported or repatriated since a wave of protests began earlier this year.
Ghana, Malawi, Mozambique, Nigeria and Zimbabwe have been organising repatriations by air or bus over the last few weeks - with about 3,500 foreigners volunteering to leave.
South African authorities claim more than 500 Nigerians repatriated did not have correct papers, which Nigeria has disputed.
Xenophobia has long been an issue in South Africa, and has sometimes led to violence.
According to the African Centre for Migration and Society's (ACMS) xenophobic violence tracker Xenowatch, two people have been killed this year.
In 2008, more than 60 people died during a wave of rioting against non-South Africans.
Latest Stories
-
President Mahama ends Resetting Ghana tour of Ahafo Region
50 minutes -
African negotiators seek delivery of climate commitments at COP31
51 minutes -
BoG develops AI rules for financial sector
53 minutes -
‘Big Push’: Government assures contractors of prompt payments
58 minutes -
Court fines miner for breaking into gold buying shop
1 hour -
Tarkwa court jails labourer for three years over GH¢123,000 theft
2 hours -
GAEC must retain nuclear scientists for Ghana’s nuclear ambitions – Minister
3 hours -
Man reportedly mistaken for game and shot by hunter dead in forest
3 hours -
19-year-old mason jailed 15 years for defiling seven-year-old pupil
3 hours -
Ghana’s banking sector assets rise 20.47% to GH¢500.2bn – BoG Governor
3 hours -
22 injured as Sprinter bus overturns at Sege after tyre burst
3 hours -
UN housing expert urges Ghana to strengthen Rent Control Department amid housing affordability concerns
3 hours -
Delta-BCI partnership reaches 166,000 people with breast cancer education
3 hours -
Power restoration fault suspected in Kumasi Central Market fire
8 hours -
The 7-foot giant of Ngleshie Amanfro: Seven-foot Ghanaian Ephraim Saawa dreams of joining the national basketball team
9 hours