South Africa plans to begin charging foreign governments for the cost of deporting their citizens who are detained in the country and returned home, a government official has said.

Chrispin Phiri, spokesperson for South Africa's Department of International Relations and Co-operation (DIRCO), disclosed the plan during an interview with SABC on June 9.

According to Phiri, the government intends to recover costs associated with detaining and deporting foreign nationals who violate South African laws.

"Moving forward, we will also be billing countries for their foreign nationals who have to be deported or who are in our criminal detention facilities and have to be deported back into their countries," he said.

Phiri added that recent evacuations organised by several African governments demonstrated that countries have the capacity to receive and transport their citizens when necessary.

"At least now we can see that there's capacity for countries to extract the foreign nationals who have fallen foul of the law. That's something that, through the Department of Home Affairs, we will pursue as a government," he said.

The announcement comes amid renewed tensions linked to anti-immigrant violence in parts of South Africa. Several African countries, including Nigeria, Ghana and Malawi, have evacuated some of their citizens following attacks targeting foreign nationals.

The unrest has seen groups of South Africans accuse migrants of taking jobs and contributing to social and economic pressures, leading to attacks and calls for foreigners to leave the country.

Last week, South African President Cyril Ramaphosa condemned the harassment of individuals based on their nationality. In a national address, he warned against demands for proof of citizenship on the streets and pledged action against those responsible for the violence.

Despite the government's assurances, reports indicate that attacks on African migrants have continued in some areas, with concerns raised over the effectiveness of law enforcement responses.