Spain stamped out immediate fears of a banking catastrophe Thursday by nationalising its fourth-largest listed bank, Bankia, and salvaging its balance sheet, strewn with red ink.
Bankia's stock slumped but the rest of the financial sector rallied after the U-turn by Prime Minister Mariano Rajoy's government, which had refused to countenance using public money.
The government announced the state would take a 45-percent stake in Bankia by converting a state-backed loan of 4.465 billion euros ($5.8 billion) into shares in the parent company.
The transaction, announced late Wednesday, means the government "will take control", an Economy Ministry statement said.
"One of the main worries over the entity has been lifted, even if we are still waiting to see the restructuring plan," said a report by brokerage house Renta 4.
"It is news we consider positive," it said.
Bankia fell 3.62 percent to close at 2.053 euros ahead of the state takeover, which would dilute other shareholders' stakes and could threaten the payout of dividends.
But the rest of the market rallied, sending the leading IBEX-35 index up 3.42 percent to close at 7,045.7 points. Santander, the eurozone's largest bank by capital, was up 5.02 percent.
Bankia, an amalgam of seven shaky savings banks that fused in 2010, has been at the centre of financial sector concerns.
The bank had the industry's largest exposure to the property market at 37.5 billion euros at the end of 2011, of which 31.8 billion euros were classed as problematic.
Bankia's grave balance sheet woes forced executive chairman Rodrigo Rato, a former head of the International Monetary Fund, to hand in his resignation Monday.
He was replaced Wednesday by experienced banker Jose Ignacio Goirigolzarri, who immediately cried out for state help.
Madrid is throwing a lifeline by converting into capital a five-year state loan extended in December 2010 at an annual interest rate of 7.75 percent to Bankia parent group Banco Financiero de Ahorros (BFA).
One of the biggest worries for investors is that they do not know the real value of the banks' exposure to the property sector, nor how far the troubles have spread.
"The general feeling is that Spanish banks have worse problems than previously thought," said Edward Hugh, an independent economist based in Barcelona.
Larger banks such as Santander and BBVA were expected to do better because of their external operations, he said.
But the Bankia move may not be sufficient, Hugh warned.
"I think we are a long way from recognising the true extent of losses," he said.
"Clearly this is another step forwards of recognising some of the losses. At each stage we get a government official saying that this latest one is the worst and then something else happens."
Hugh said he expected that at some point the European Union would have to intervene to rescue the sector.
The state takeover provides a grim backdrop to Spain's banking reforms, expected to be announced Friday.
An economy ministry official said the government would issue new rules on forcing banks to boost their financial cushion against property assets, declining however to give a figure.
The new requirement could amount to 35 billion euros, said business daily Cinco Dias. That is in addition to the 53.8 billion euros in provisions already demanded in a reform announced in February.
In an attempt to soothe markets, the government had already said it would approve on Friday another reform aimed at enabling banks to transfer problem loans from their balance sheets to separate agencies. But it has said this will be done without using state money.
Spain's press largely welcomed the intervention in Bankia.
"The executive's decision should serve to show the markets that the clean-up policy is serious and that there is decisive action to support the financial system without hiding its problems," said an editorial in conservative daily ABC.
The leading daily El Pais said the government action should resolve market doubts over Spanish banks, at least in theory.
"But despite the firm political action on Bankia, investors have the impression that the government lacks an articulate plan to clean up the banks and re-establish confidence and credit," it said.