South African authorities arrested roughly 400 people in Johannesburg, some of whom were believed to be in the country illegally, media said Friday. Above, demonstrators carry placards during a march against xenophobia in downtown Johannesburg, April 23, 2015. Reuters/Mike Hutchings

South African authorities in Johannesburg have arrested roughly 400 people, some believed to illegal immigrants, local media reported Friday. The raid comes amid a growing number of attacks on foreigners and rising xenophobia in the country.

The Department of Home Affairs would be checking detainees' immigration documentation, Katlego Mokgale, a spokesman for the South African Police Services, said, according to the news agency eNCA. The raid was carried out by the South African National Defense Force, the Department of Home Affairs, South African Police Service and the Johannesburg Metro Police Department, Mokgale added.

Several buildings were scoured for people, including a Methodist Church, and those arrested were put into trucks and driven to the Johannesburg Central Police Station. "We are not arresting everyone," Mogale said, according to News24. "We are taking them to Johannesburg central police for verification."

Other parts of the country have adopted similar operations, described as being for the purposes of tackling crime, as the country deals with rising anti-immigrant sentiment and a spate of attacks on foreigners. In the province of KwaZulu-Natal, more than 108 people have been arrested as part of Operation Fiyela, which "aims to clean up our streets of criminal elements and make our neighborhoods safer," according to a press release. "Criminal dens were targeted during these intelligence driven operations," the release added, with security forces arresting people for illegally dealing alcohol and drugs, as well as 68 people who were suspected of being illegal immigrants.

Some have criticized South African Zulu King Goodwill Zwelithini for inciting violence and attacks on foreigners. In a speech in March, he blamed immigrants for the increase of crime in the country and called for them to leave. Subsequent attacks on African migrants in South Africa left seven dead.

South African Home Affairs Minister Knowledge Gigaba condemned the violence in a speech before the National Assembly in April. "Most foreign nationals make a very positive contribution to our society and economy," he said. "We must accordingly be very clear that immigrants are welcome in South Africa."