Eurozone finance ministers have approved the terms of €100 billion bailout package for Spain.
The exact amount that Spain will borrow from the eurozone to recapitalise its banks will only be determined in September.
In return for the loan, Spain will have to restructure its banking sector and its assets, and improve governance and regulation, the ministers said in a statement.
However, Madrid will also have to honour its government deficit reduction targets and commitments on structural reforms and rebalancing of its economy, undertaken under separate procedures of the EU.
The Spanish government remains under considerable domestic pressure due to the tough austerity measures it is introducing in order to bring down the national deficit.
Public sector workers demonstrated again last night in many Spanish cities, as the protest movement continues to grow.
Last week, Spanish Prime Minister Mariano Rajoy announced an austerity package of €65bn, which he said was necessary to sort out the financial mess left by the last Socialist government.
However, the mixture of tax hikes and spending cuts has resulted in a storm of protest and sparked demonstrations across Spain.
Trade unions called protests in 80 cities last night.
In Madrid, protesters gathered outside the headquarters of the ruling People's Party, shouting "Hands up! This is a stick-up!"
Meanwhile, Finland's parliament has approved a rescue package for Spanish banks, despite criticism from opposition parties who are against eurozone bailouts.
A total of 109 lawmakers supported the bailout, while 73 opposed it and 17 were absent from today's vote.
Finland earlier secured a deal with Spain to receive collateral in exchange for the loans, an agreement modelled on an earlier deal with Greece.