IF SPAIN were a patient, the mood in the hospital ward would be tense. Every attempt by local specialists advised by renowned European consultants to treat the sickness brings no more than temporary relief. Even more worrying, the relapses after each dose are happening sooner and sooner. Spain’s chances of avoiding intensive care—a full bail-out—are receding to near vanishing-point.

The symptoms of Spanish sickness are manifest in ten-year government bond yields touching 7.75% on July 25th; previous bail-outs of Greece, Ireland and Portugal occurred not long after rates had surpassed 7%. Even more perturbing, two-year yields also briefly went above 7%, in effect foreclosing the government’s ability to borrow at anything but short maturities.

No isolation ward is possible in the financially integrated euro area and Spain’s sickness quickly infected other countries. The Italian ten-year bond yield went above 6.5%, its highest since January. European stockmarkets retreated and Italy’s fell to a euro-era low. Sentiment was further soured by a report from Moody’s, a ratings agency, saying that Germany, Luxembourg and the Netherlands might lose their cherished triple-A status. The prognosis was based in part on fears about the public-debt burden that northern countries might have to assume if bail-outs spread.

The market funk was the more troubling since a Spanish government with a lot going for it had appeared to be getting a grip. Public debt is rising fast, but at 69% of GDP last year was far lower than Italy’s 120%—and less even than Germany’s 81%. The budget deficit is high (8.9% of GDP in 2011), but only a week before the market panic Mariano Rajoy, the prime minister, announced more tough austerity measures. And on July 20th European finance ministers sanctioned the first tranche of a partial bail-out worth up to €100 billion ($121 billion) for Spanish banks.

So why are investors in such a cold sweat about Spain? One reason is that Mr Rajoy flunked hard choices at the outset, notably the cleansing of the banks. Despite a low starting-point for public debt, deficit overshoots have revealed insufficient central control over the 17 regions that are responsible for a big chunk of spending. Investors fret that more regions may follow Valencia, which applied for aid on July 20th. They are in any case sceptical that Spain can meet its targets for cutting the deficit in the teeth of a recession that is harsher than expected.

The biggest worry is Spain’s external debt. Spain ran hefty current-account deficits in the first decade of the euro. As a result, its liabilities to foreign investors exceeded the assets that its residents own abroad by 92% of GDP last year, among the highest in the euro area. The problem for Spain is that foreign capital has been fleeing over the past year. That has weakened the banks and the economy and left the Spanish government shunned by foreign investors for its own financing needs.

The European summit in late June offered a flicker of hope but it is guttering. Euro-area leaders agreed that the European Stability Mechanism (ESM), their new permanent rescue fund, would be able to inject funds directly into banks rather than via loans to the government. That perked markets up since it promised to sever the link between weak banks and weak sovereigns. But before long the deal looked less solid: the ESM cannot come into force until September, when Germany’s constitutional court will rule on its legality. Assuming it passes that test, the ESM cannot be used for direct bank recapitalisation until a European supervisor is put in charge.

Spain may yet be able to fend off a bail-out for some time. It has some cash reserves and can still borrow at short maturities. The euro area also has its temporary rescue fund, which will lend the Spanish government the initial sum of money for the banks. But even if Spain survives a hot summer, the markets are signalling that it will need a full bail-out later this year.

That would be a nightmare, and not just for Spain. The Spanish government must borrow €385 billion until the end of 2014 to cover its budget deficit and other needs such as bond redemptions, according to economists at Credit Suisse. Even if the IMF chips in a third as in previous bail-outs, European lenders would have to find €250 billion or so. They have already committed €100 billion to rescuing Spanish banks, so for other emergencies they would have only €150 billion of the €500 billion now in their rescue kitties.