Spain sold more short-term debt than planned on Tuesday, with demand shored up by expectations the country will soon ask for aid after ratings for some of its most indebted regions were cut to "junk".

The sale came as the Bank of Spain warned the economy would stay in recession in the third quarter and said the country could miss a deficit target agreed with the European Union because of lower tax revenues owing to the slump.

Spain is the focus of the three-year-old euro zone debt crisis after markets pushed its refinancing costs to near unsustainable levels this year because of concerns over its high deficit and ailing economy.

Expectations it will soon ask for a financial lifeline that would allow the European Central Bank to buy the country's bonds have helped bring yields down, although markets are increasingly impatient for action.

"We were expecting to see a request made after the regional elections (on Sunday), or in early November, but the risk is that the decision is delayed," said Simon Peck, analyst at RBS, following Tuesday's auction.

Rajoy, who was given a boost for his austerity drive with an election victory in his home region of Galicia on Sunday, said last week he had not yet taken a decision on whether to seek aid.

Spain's regional governments were largely to blame for the country missing its 2011 deficit target by nearly 30 billion euros, and are at risk of overspending again this year.

JUNK GRADE

All but shut out of international markets and reliant on central government aid to meet debt payments, five regions were downgraded late on Monday by rating agency Moody's, including Andalusia and Extremadura, which were cut to junk grade.

The agency said the downgrade reflected a deterioration in liquidity positions, limited cash reserves and the regions' reliance on short-term credit lines to fund operating needs. It kept negative outlooks on the five regions' ratings, all of which are now below investment-grade.

While an 18-billion-euro credit line from the central government reduced the immediate risk of a regional default, Moody's said regions would struggle to find a long-term funding solution and to cut their deficits as the economy contracts.

The autonomous region of Madrid, which represents about a fifth of the country's economic output, postponed a planned bond issue on Tuesday, saying market conditions were not optimal.

The Bank of Spain said on Tuesday that Spain was at risk of missing its 2012 budget deficit target of 6.3 percent of GDP, including regions and social security, as a prolonged recession slashes revenues.

Treasury Minister Cristobal Montoro said the central government was close to meeting its own 4.5 percent deficit target, which excludes the regions and the social security system, with a 3.9 percent deficit at end-September.

But a document sent to the European statistics office showed the social security system was set to register a deficit of 10.5 billion euros in 2012 compared to an initial forecast of a balanced budget.

Separately, lobby group Farmaindustria said the regions, which control spending on healthcare and education, have run up 2.3 billion euros of debt to pharmaceutical companies since Jan. 1.

YIELDS

A few hundred people demonstrated around the parliament on Tuesday afternoon as next year's budget was being discussed but the movement did not manage to attract as many people as on Sept. 25, when thousands of people took the streets of the Spanish capital.

The downgrades for the regions pushed up Spanish yields on the secondary market, with that on the benchmark 10-year bond rising to 5.5 percent from a six-month low of 5.297 percent plumbed on Friday.

Subscriptions rose at Tuesday's bill auction, however, with three-month bills 4.3 times subscribed after being 3.3 times subscribed in September. The six-month bills had a bid-to-cover ratio of 2.0 after 1.8 last month.

Spain sold 3.53 billion euros ($4.6 billion) of debt, more than the 2.5 billion to 3.5 billion euros it had targeted.

The average yield on the 967 million euros of three-month paper was 1.415 percent, up from 1.203 percent last month, while that on the 2.6 billion euros of six-month T-bills was 2.023 percent, lower from 2.213 percent a month ago.

The Bank of Spain also said on Tuesday that economic output would shrink by 0.4 percent in the third quarter from a quarter earlier, the same as in April-to-June, partly reflecting a slowdown in the wider euro zone economy.

"The third quarter has been characterised by a generalised weakening in exports ... the persistence of restrictive financing conditions, and high uncertainty linked among other factors to European and domestic reforms being carried out," the bank's monthly report said.

Austerity measures being carried out by the government were clearly contracting the economy further, the central bank said. Spain has announced austerity measures worth over 60 billion euros to be made until 2014.

A preliminary official reading of Spain's GDP, usually in line with the central bank's estimate, is due on Oct. 30.