The immigrants spent the night in Barcelona's Sant Bernat Calbó church with the permission of the local priest after being evicted from industrial warehouses.
The evictions from the two run-down facilities in the city's Poblenou district were carried out by police without incident, Spanish news agency Efe reported.
City authorities said they offered accommodation to the hundred or so tenants of the warehouses immediately after their eviction, according to Catalonian daily El Periódico.
Local groups supporting the immigrants responded by saying the accommodation on offer was only good for three days.
But authorities said this housing would be on a longer-term basis, as this was an emergency situation.
Barcelona's town hall previously promised they would find accommodation for all of the former residents of the warehouses and municipal sources say they have rehoused 137 ex-residents since January.
Groups supporting the immigrants say this rehousing process has, however, been too slow.
Now, in the latest development, more than 50 of the people living in the two warehouses have locked themselves inside a church in protest.
With their protest, the immigrants — many of them Nigerians and Senegalese — hope to make the mayor of Barcelona, Xavier Trias, "fulfill his promise" to leave no one in the street.
"This is not about sleeping, it's about fighting for a dignified place to sleep," said Enrique Mosquera, the spokesperson for one local social rights group.
The immigrants — many of who make a living by selling scrap metal — will meet with officials from Barcelona's town hall on Thursday to thrash out details of possible new accommodation.
They also hope to put pressure on authorities with the hope of seeing their residency in Spain legalized.
Wednesday night in the church passed quietly, members of one local anti-evictions group told Spanish news agency Efe.
Locals brought members of the group food and other items.