South African police have raided Johannesburg's Central Methodist Church, arresting around 1,500 homeless people and Zimbabweans.
Dozens of police, some heavily armed, raided the church compound, rounded up those there and took them away.
The police said they were looking for drugs, guns and illegal immigrants.
But Paul Verryn, the church's bishop, described the raid as a violation of the sanctity of the church. "I think it is despicable," he told the BBC.
'Violation of rights'
Bishop Verryn said he would have gladly co-operated with the police if they had asked for his help to search the building and check the papers of those inside.
He said the way the police handled those they arrested during the raid was a clear violation of their rights.
It was, he added, an attack on the very institution of the Church.
An AP news agency reporter said several doors had been forced open and a window smashed.
"Until now, I have not had any reports that guns were found," Bishop Verryn told the BBC's World Today programme.
Asked whether he should be providing shelter to people who may not have the right to be in South Africa, he said: "Absolutely."
He said he had been "bullied" by the police, who had grabbed him by the belt.
As well as the 1,200 homeless and Zimbabwean refugees who usually sleep inside the church, there were some 500 more on the grounds outside.
Some of those arrested, whose papers were in order, have since returned to the church.
Wednesday night's raid is the first time the police have targeted the Central Methodist Church, which is widely respected as a shelter for some of the city's most desperate people.
The BBC's Peter Greste in Johannesburg says that until recently, the authorities had adopted a relatively tolerant approach to the hundreds of thousands of Zimbabweans seeking refuge from the political and economic meltdown in their home country.
But as South Africa's own economy starts to strain, the government has begun to stiffen its attitude to refugees, our correspondent says.
An estimated three million Zimbabweans are believed to be living in South Africa.