But the exact size of the loan will probably only be disclosed in September, when Spain’s government gets the results of an audit of its banks.
In return for the loan, Spain has to restructure, and improve the governance and regulation of its banking sector.
Fears about Spain’s financial health have pushed its borrowing costs higher.
New data this week indicated that the Spanish banks own 155.84bn euros of loans that might not be repaid in full.
The bank rescue plan, together with new austerity measures by Madrid, is aimed at avoiding a full-scale bailout of the Spanish government.
The International Monetary Fund welcomed the finance ministers’ decision to grant financial assistance, saying the measures would help to “significantly strengthen Spain’s financial system, an essential step in restoring growth and prosperity in the country”.
Eurozone ministers, taking part in a conference call, approved a memorandum of understanding with Spain, which will be signed in the coming days.
The aid will be fully disbursed by the end of 2013.
“We have formalised what we discussed in the past two Eurogroup meetings,” Luxembourg’s Finance Minister Luc Frieden said after the conference call.
“We have formally approved the memorandum that lays out the conditions under which Spain can be lent money for the recapitalisation of its banks.
“The approval of all 17 ministers is there, and that means that the programme can continue. Money will not flow immediately, because work on the analysis of the specific banks is ongoing.”
Spanish shares fell after the aid package was approved. The Madrid stock market was down 3.6% in afternoon trading, with bank shares among the weakest performers.
Also on Friday, Spanish Treasury Minister Cristobal Montoro said the country’s recession would drag on into 2013, although the economy would not perform as badly this year as previously thought.
The government now expects the economy to contract by 1.5% in 2012 and by 0.5% in 2013. It had previously forecast contraction of 1.7% this year and growth of 0.2% next year.
The German parliament cleared the country’s participation in the bailout of Spain’s banks on Thursday. In Finland on Friday, MPs also voted to participate in the rescue, although 73 MPs in the 200-seat parliament voted against or were not present.
Meanwhile, there are fresh signs in Spain of public opposition against the demands being imposed on the country by eurozone leaders, with more than a week of demonstrations across the country.
An audit of Spanish banks by consultancy firms Oliver Wyman and Roland Berger, published last month, showed the banking sector needed up to 62bn euros in aid.
A second audit and new stress tests, to be published in mid-September, will help determine how much money each bank needs.
Spain’s three biggest banks, Banco Santander, BBVA, and Caixabank, are not thought to need money, but some 10 others may do.
The worsening position of many lenders was underlined this week when Spain’s central bank disclosed that they had 155.84bn euros of loans on their books in May that are at risk of not being repaid in full.
The figure is the highest since 1994, and represents about 8.95% of total lending extended by Spanish banks.
Nervousness about Spain’s fragility pushed the 10-year bond yield – the annual cost implied by market for Spain’s government to borrow new money – above 7% for the first time in a week on Thursday.
It followed a surge in the government’s actual realised cost of borrowing at a 3bn-euro debt auction.