Those being detained were caught traveling in a truck on which they were secretly loaded in the cargo on Wednesday night.
Chief Police Information and Communication Officer Superintendent Phindile Vilakati said the foreigners who included a baby were charged with c ontravening the Immigration Act and are expected to appear in court.
"The truck they were travelling in failed to climb a steep hill and plunged into a ditch. When the police went there to attend the minor accident they heard voices in the cargo and upon inspection it was discovered that 21 people were inside it," she explained.
The officer said during interviews the foreigners claimed they had abandoned their businesses in Durban, South Africa to flee the attacks on non-citizens.
The truck driver is still on the run after fleeing from the scene of the accident.