Three protesters from the global feminist group Femen made headlines when they began chanting "Abortion is sacred!" during Wednesday's parliamentary session.
After some initial confusion, the topless women were removed from the parliament's public viewing gallery by security agents.
They were then remanded in detention.
But the magistrate overseeing the case on Wednesday evening decided to release Spain's Lara Alcázar, Frenchwoman Pauline Hillier and the Ukranian Inna Shevchenko.
"In the current social reality it doesn't seem reasonable to argue that a protest where you people uncover their torso is can produce a serious threat to public order," said Madrid judge Ramiro García de Dios Ferreiro.
He also explained that while the protesters' shouts could be considered as a threat to public order, the words they had used were not.
The only condition of the protesters' release is that the three women have a Spanish address for correspondence purposes.
Prime Minister Mariano Rajoy came to power in 2011 promising to change a more liberal abortion law passed the previous year by the then Socialist government.
Rajoy's conservative Popular Party and the Roman Catholic Church have hotly opposed the 2010 abortion law, which allows abortion up to 14 weeks of pregnancy or up to 22 weeks if the foetus is deformed.
Now the government seems set to return Spain to the earlier 1985 law, which decriminalized abortion only in cases of rape, deformation of the foetus or serious physical or psychological risks to the mother.