* Spain auctions bonds due 2015, 2016, 2022
* Treasury sells 4.6 billion euros
* Yields lower on all three maturities
By Paul Day
MADRID, Oct 18 (Reuters) - Spain sold more debt than it planned and its funding costs fell on Thursday after Moody's affirmed its credit rating and signs that Madrid will soon ask for aid soothed investors nerves.
There was good demand for the three bonds and the yield on the 10-year was the lowest at an auction since January. The Treasury raised 4.6 billion euros ($6 billion), just above target, meaning it has nearly completed the 2012 debt programme.
Spain has become the focal point of the three-year-old euro zone debt crisis and premiums on benchmark debt have soared to nearly unsustainable levels on concerns Madrid cannot control its finances during a deep recession.
But Moody's left Spanish debt with an investment grade rating on Tuesday, confounding expectations for a downgrade and helping investor sentiment.
The agency suggested the rating depended on Spain requesting European aid which it is expected to do in the next few weeks. This would trigger European Central Bank bond buying, further easing pressure on Spanish debt.
"Today's auction went very well, following yesterday's rebound of the Spanish debt," said Annalisa Piazza, market economist, Newedge Strategy, London.
"Dealers willing to close their shorts and hope of some relevant decision on the future of Spain in the coming weeks have been supportive factors at today's auction."
The premium investors demand to hold Spanish over German debt dropped to around 377 basis points after the auction, around 10 bps down on the day and far from 640 bps in July.
Spain, which has already received a commitment of up to 100 billion euros to recapitalise its banks, is ready to ask the euro zone for a bond market support package, European officials have said, but Germany has urged it to hold off.
The Spanish government has said it is still examining the details of the aid plan and ECB intervention, with Prime Minister Mariano Rajoy keen to avoid adding strict conditions to an unpopular austerity plan.
Spain's business leaders have also been putting pressure on the government to move quickly in the hope the ECB plan will reopen access to international debt markets, with Bankinter Chief Executive Maria Dolores adding to those calls on Thursday.
European leaders gather in Brussels on Thursday to try to bridge deep differences over plans for a banking union but no substantial decisions on that or other euro zone issues are expected.
Spain's sold 1.5 billion euros of its benchmark 10-year bond at an average yield of 5.458 percent, down from 5.666 percent at its previous primary auction on Sept. 20.
The bond maturing July 30, 2015, sold 1.6 billion euros at an average yield of 3.227 percent down from 3.676 on Sept. 6 while the bond due Oct. 31, 2016, sold with a yield of 3.977 percent, compared to 4.603 percent on Sept. 6.
Spain has now raised 92.1 percent of its targeted medium- and long-term issuance for 2012 and has four more bond auctions planned before the end of the year.