HAD Ireland's government expected to be rewarded by investors after caving in to pressure to seek salvation from the European Union and the IMF, it was soon disabused. So were those who hoped that the crisis engulfing the euro could be contained at the River Liffey. Unlike the relief rally when the EU bailed out Greece in May, investors this time barely paused for breath before continuing to dump Irish assets, as well as those of Portugal and Spain. The euro's future will be secure only when this contagion is banished. And that, it is now clear, crucially depends on what happens in Spain.

Europe's rescue plan is based on the idea that Ireland and the rest just need to borrow a bit of cash to tide them over while they sort out their difficulties. But investors increasingly worry that such places cannot, in fact, afford to service their debts—each in a slightly different way. In Ireland the problem is dodgy banks and the government's hasty decision in September 2008 to guarantee all their liabilities. Some investors think this may end up costing even more than the promised EU/IMF loans of some €85 billion ($115 billion)—especially if bank deposits continue to flee the country (see Buttonwood). Ireland's failing government adds to the doubt, because it could find it hard to push through an austerity budget before a new election (see article). In Greece the fear is that the government cannot raise enough in taxes or grow fast enough to finance its vast borrowing. Likewise in Portugal, which though less severely troubled than Greece nevertheless seems likely to follow Ireland to the bail-out window.

If the panic were confined to these three, the euro zone could cope. But Europe's bail-out fund is not big enough to handle the country next in line: Spain, the euro's fourth-biggest economy, with a GDP bigger than Greece, Ireland and Portugal combined.

On the face of it, the Spanish fears look exaggerated. Although it shares something of Ireland's banking woes and of Greece's wretched competitiveness, it is in less trouble than either. Its public debt, at around 60% of GDP, is below both Germany's and the EU average. Its big banks are strong. Its multinationals are increasing their exports. In May, when investors ditched Spanish assets during the Greek panic, José Luis Rodríguez Zapatero, Spain's prime minister, abandoned the notion of spending his way out of recession. Instead he ordered spending cuts and then tax rises to trim the budget deficit from 11% of GDP in 2009 to 6% next year. And, prodded by the Bank of Spain, the authorities are trying to force through mergers of cajas, the troubled savings banks that financed Spain's disastrous property bubble.

Then Mr Zapatero, who has shown no real understanding of the need for reform, made a big mistake. Partly because those measures won him some respite from the markets, and partly because his U-turn brought a ten-point fall in support for his Socialist Party and a general strike by his friends in the unions, he put off other reforms. Now he is once more facing wild-eyed markets and a widespread perception that Spain's economy will fail to grow. Unemployment is stuck at over 20%, while inflation is higher than in Germany. Public debt is low, but the debts of Spanish households and firms are far above the European average. They are being financed from abroad: the current-account deficit is still over 4% of GDP. The banks and the cajas have yet to own up to the full extent of losses on property loans; the impenetrable accounts of regional governments invite suspicion.

Zapateuro

When markets are eaten up by worry it is never easy to change their minds. If he is to do so, Mr Zapatero must take several steps fast. First he must produce a credible medium-term fiscal plan. That means coming clean about debts in the banking system and the regions and speeding up a plan to raise the pension age from 65 to 67. Second, he must do more to help Spanish firms compete—because once it is clear that Spain can grow, its debts will look a lot less scary. His labour-market reform was very timid. A rigidly centralised system of wage bargaining mandates annual pay rises, come what may. He has postponed reforms to pensions and collective bargaining until next year. They may then fall hostage to local and regional elections, before a general election in 2012 that the Socialists will surely lose. So he should redouble efforts to forge a pact with the opposition, and push on with reforms.

The future of the euro rests with Germany and the European Central Bank—they, after all, are the places with the money. But right now, Mr Zapatero is the key. If he acts swiftly, he could play a vital part in saving the currency from collapse.