Spain has given up the battle to rescue its ailing banks alone and accepted a European bailout of up to €100bn to join Greece, Ireland and Portugal in requesting outside aid to survive Europe's debt crisis.

European leaders hope a bailout will prevent a wider deterioration of the eurozone's fourth largest economy, which is paying punishing interest rates on borrowed money and is key to the survival of the single currency.

"The Spanish government states its intention to request European financing for the recapitalisation of banks that need it," the country's finance minister, Luis de Guindos, said after an emergency video conference with fellow eurozone ministers.

It remained unclear, however, exactly how much of the €100bn Spain would need, with De Guindos saying it preferred to wait for two independent reports on its banking system before making a formal request. These reports would be ready within weeks or days, according to De Guindos, who implied that the final sum would be lower than €100bn. "The €100bn sum is a maximum figure," he stressed. "It includes a considerable margin of security."

Eurozone policymakers had been eager to shore up Spain's position before 17 June elections in Greece that could push Athens closer to a eurozone exit and unleash contagion. Various estimates have put the outside capital needed by Spanish banks at between €40bn and €100bn. "The loan amount must cover estimated capital requirements with an additional safety margin," the eurozone ministers said.

Mariano Rajoy, Spain's conservative prime minister, left explanations of the dramatic request for outside help to De Guindos, who told Spaniards that this was a simple loan rather than a bailout. The prime minister will travel to Poland on Sunday to watch Spain play Italy in Euro 2012 as his government tries to project an image of business as usual. Spain's acceptance of aid for its banks is an embarrassment for Rajoy, who said recently that the banking sector would not need a bailout.

There was confusion about conditions of the bailout. De Guindos claimed these required Spain to take measures in the finance sector but did not involve austerity.

Eurozone finance ministers, however, warned they would closely monitor Spain's ability to stick to deficit targets and structural reforms. There were reports of heated arguments over the conditions, with several countries initially wanting Spain to be placed under far stricter controls.

The IMF said it would limit itself to helping monitor banking reform. The money will be funnelled through Spain's existing bailout fund, called the Frob, and will add to the country's modest but quickly growing national debt with the government "retaining the full responsibility".

A bailout focused on its banks will ensure Spain can still borrow money on the markets to cover government spending. That makes the bailout very different from those of Greece, Portugal and Ireland. An IMF report estimated Spain needs at least €40bn for its banks to cover toxic real estate assets left over from a burst housing bubble.

Washington, which is worried the eurozone crisis could drag the US economy down in an election year, welcomed the measures. "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," treasury secretary Timothy Geithner said.

Analysts said financial markets may also be calmed by the announcement.