More than 200 male foreign nationals will appear in the Krugersdorp magistrate's court today for allegedly obstructing traffic on the R28 highway on the West Rand.
The immigrants were removed from the side of the road by the police on Monday night after camping there for the past week.
Police spokesman Superintendent Lungelo Dlamini said only the men were charged, while the women and children had been taken to a place of safety.
The immigrants were released from the Lindela repatriation centre last week. They were taken to Lindela after they refused to register for temporary identification cards issued by the Department of Home Affairs at the Glenanda camp south of Johannesburg.
Home Affairs spokesman Siobhan McCarthy said it was not the responsibility of the department to provide alternative accommodation for the immigrants.
"Once they left Lindela they fell outside the jurisdiction of home affairs," McCarthy said.
She said 15 asylum-seekers awaiting the outcome of their applications had remained at the centre.
Abel Mbilinyi, deputy regional representative of the UN High Commissioner for Refugees in Southern Africa, said the organisation had registered 86 refugees who wanted to be repatriated voluntarily and expected to register more asylum-seekers.
Gauteng provincial spokesman Thabo Masebe said it was not the government's responsibility to find shelter for the foreigners. But they were free to find alternative places to live if they could not return to their communities.
Loren Landau of Wits University's Forced Migration Studies Programme said reintegration should be a gradual process and that foreign nationals should have been given an opportunity to engage with communities about their return.
Landau said a plan outlining how the police would curb future attacks and respond if they recurred was needed.
Landau said the xenophobic attacks were fuelled by the perception that the government had little control over its borders and other factors such as insecurity about unemployment.
"The South African borders are porous but so are borders elsewhere in the world," Landau said. "It would be hard to say that South Africa hasn't made efforts to control its borders."
Landau said increased border control would result in migrants staying longer in the country, more corruption and human rights abuses at the borders and more deaths as people would use "more dangerous methods to cross".
She criticised the government for its slow reaction to the attacks but said the erection of temporary shelters was a "necessary short-term measure" to cope with the violence.