Eurozone finance ministers decided on Saturday to lend Spain up to €100bn ($125bn, £80bn) to save its troubled banking sector.
The aid is expected to cover all capital requirements Spain's banking sector needed.
"The loan amount must cover estimated capital requirements with an additional safety margin, estimated as summing up to 100 billion euros in total," said the Eurogroup statement.
The decision came after a heated conference call by the Eurogroup, the group of finance ministers from the 17-nation single currency area which lasted about two and half hours.
Madrid is yet to decide on the exact bailout fund they needed which will be decided after the results of the independent audits of the banking system by auditors Oliver Wyman and Roland Berger.
The results are expected before 21 June.
"The Spanish government declares its intention to request European financing for the recapitalisation of the Spanish banks that need it," said Spain's Economy Minister Luis de Guindos at a news conference in Madrid.
The funding would be from the two funds created to help eurozone members in financial trouble - the €440bn European Financial Stability Facility (EFSF) and its successor the €500bn European Stability Mechanism (ESM), which comes into force in July.
The International Monetary Fund (IMF) will not be providing any money, but agreed to monitor the banking sector reforms.
Why Spain Bailout Different from Others
With the latest bailout, Spain became the fourth eurozone country to seek financial aid. Portugal, Ireland and Greece have already received the EU/IMF bailout.
However, there are considerable differences in the bailout conditions on Spain and other aid recipients.
Unlike the other three nations, which are already the recipients of the EU bailout fund for their sovereign debts, Spain's bailout is only for its banking sector, not for the economy as a whole.
Spain's aid is for saving its banking sector which is besieged by bad loans and property bubble burst.
Moreover, Spain is in recession and a number of government imposed austerity measures are already in place.
This makes Spain insulated from the strict conditions of the EU bailout and there will not be any new austerity measures attached to it.
"This is not a rescue," said De Guindos.
A Welcome Move
The decision of Spain to seek bailout fund was welcomed across the western world.
Washington expressed its relief at the development and termed it an important step towards financial union of the eurozone.
"These are important for the health of Spain's economy and as concrete steps on the path to financial union, which is vital to the resilience of the euro area," said Timothy Geithner, US Treasury Secretary.
G7 nations also welcomed the move as a milestone towards the path of eurozone's financial and budgetary union.
IMF opined that the bailout is big enough to restore the credibility of Spanish banks.
"I strongly welcome the statement by the Eurogroup, which complements the measures taken by the Spanish authorities in recent weeks to strengthen the banking system," said Christine Lagarde, the IMF managing director.
"The IMF stands ready, at the invitation of the Eurogroup members, to support the implementation and monitoring of this financial assistance through regular reporting," she added.
Meanwhile, analysts are expecting the markets to be positive on the Eurogroup decision when they reopen on Monday.
"The figure of up to 100 billion is more encouraging and pretty realistic; it's an attempt to cap the problem," Reuters quoted Edmund Shing, European head of equity strategy at Barclays as saying.
"The issue, however, is there is still a lack of detail about where the money's coming from, which is crucial. The market will treat it with some caution until they see how it will be funded," he added.
Spain's Banking Worries
On Thursday, credit rating agency Fitch cut the Spain's sovereign debt rating to BBB, three notches down from its A rating. The latest rating from Fitch left Spain just two notches short of junk status.
Fitch also put the outlook for Spain's economy under negative, indicating the possibility of further downgrades.
According to the latest Fitch estimates, the recapitalisation and restructuring cost of Spain's banking sector would be around six percent of Spain's GDP (€60bn, £48.56bn) and as high as nine percent of the GDP (€100bn).
Spain's banking woes worsened with the revelation of poor finances in Bankia, the country's fourth largest bank which restated its accounts to a loss at €2.98bn instead of an earlier claim of €309m profit.
Bankia sought €19bn ($24bn, £15bn) on 26 May from the Madrid government.
Standard & Poor's also downgraded Bankia to junk rating and cut the ratings of four other Spanish banks.
The Spanish government has already spent €15bn to bailout small, regional banks. Bankia rescue is expected to cost the public coffers another €23.5bn.