They are mostly from African countries and were demanding to be resettled outside South Africa.
Since 2008, there have been numerous outbreaks of xenophobic violence targeting foreign nationals from the rest of the continent in townships across the country.
Migrants are often targeted in the communities where they live, accused of stealing jobs and resources.
A Burundian woman who the BBC spoke to earlier this year said she fled unrest in her home country years earlier for South Africa, a place where she thought she was safe, but was attacked and raped by a man who remained at large.
Despite requests made by the BBC, South African authorities have not disclosed the names nor the destination countries of the 20 people being deported.
In a statement, the Department of Home Affairs said it had followed “due process”, adding that “the affected foreign nationals have already been transferred to Lindela Repatriation Centre for deportation purposes”.
According to BBC’s Nomsa Maseko in Johannesburg says more migrants are expected to be deported.