Rafa Zouhier was sentenced to ten years in prison for his role in what was Spain's worst ever terrorist attack.
He is now set for a March 16th release based on time served, Spain's National Court ruled on Wednesday.
Despite not being convicted until 2007, Zouhier — a former police informant who has always maintained his innocence — was remanded in custody in March 2004.
He could now be deported under Spanish laws which make a serious crime conviction grounds for expulsion, Spanish news agency Efe reported.
In October 2007, the National Court found Zouhier guilty of acting as a middleman in a deal which saw explosives being sold to Jamal Ahmidan, the head of the terrorist cell which staged the deadly attacks.
Two other members of that cell were handed sentences totalling more than 42,000 years for 191 homicides and on 1,856 counts of attempted homicide.
A Spanish miner who sold explosives to the cell received a sentence of 34,715 years.
On March 11th 2004, a terrorist cell carried out the bombings of Madrid commuter trains, killing 191 people and leaving over 1,800 injured.
The attacks came just three days before general elections in Spain.
Spain's conservative Popular Party government of the time initially blamed the attacks on the Basque separatist group ETA.
But many Spaniards believed they were trying to deflect attention from a possible link between the bombings and Spain's involvement in the Iraq War.
The Popular Party lost the general elections and a socialist PSOE government took power, subsequently withdrawing Spanish troops from Iraq.
Spain's National Court ruled that the cell who carried out the attacks in Madrid had links with Al-Qaeda but this remains disputed.