Some 70 foreigners without residence permits who were being held in the Sangonera la Verde centre near the southeastern city of Murcia managed to escape on Wednesday evening.
"One of the foreigners first pretended to be ill, and when the ambulance came to take him away, the others rose up in mutiny," a police spokeswoman told AFP.
"More than half of the foreigners who fled have been returned to the centre. Twenty-eight are still missing."
During the revolt, men "grabbed fire extinguishers and various items to throw them," the spokeswoman said, adding that five police officers were slightly injured.
Associations and academics have regularly denounced prison-like conditions in Spain's seven immigration detention centres - some of which have overcrowded rooms, dirty restrooms and little in the way of social services or translators.
The centres are meant for people who have come to Spain without a residence permit and are in the process of being deported.
According to Spain's SUP police union, this is not the first such incident to hit the Sangonera la Verde centre.
In August, ten men escaped after a "similar altercation," it said in a statement, calling for the "immediate closure of the centre", which it said lacked personnel and posed a security risk.