The last illegal immigrants held in Archidona's unopened prison complex left on Wednesday.
The remaining 67 Algerians there were taken to the government's official immigrant centres, meaning the interior ministry fulfilled its promise to only use the Archidona building in inland Malaga province until the start of January.
Last November over 500 illegal immigrants who had arrived in Spain from Algeria were taken to the new, unused Archidona prison building as the government's other, official detention centres were full.
The move sparked a wave of protests over the supposedly inappropriate use of the prison for migrants that came to a head recently with the suicide of one of the immigrants and increasing violence among those held inside.
Although the government has always maintained that the conditions were the same as its normal centres, news also emerged this week that three held inside had tried to self harm and sources said that the recent incidents made officials keen to speed up the plan to empty out the building.
Opposition parties and campaign groups welcomed the last departures as experts visited the building to assess the repairs necessary after its temporary use.