The S&P downgrade comes with a negative outlook reflecting the credit ratings agency's view that there are significant risks to economic growth and budgetary performance, plus a lack of a clear direction in euro zone policies.

"In our view, the capacity of Spain's political institutions (both domestic and multilateral) to deal with the severe challenges posed by the current economic and financial crisis is declining," S&P said in a statement.

S&P's two-notch downgrade from BBB-plus brings it in line with Moody's Investors Service's Baa3 rating. Moody's has Spain on review for a possible downgrade.

Both firms have Spain just on the cusp of junk status. Fitch Ratings has a BBB rating on Spain, one notch higher but also with a negative outlook.

A spokesman at Spain's Economy Ministry told Reuters the government had no comment on the ratings.

The country has been in recession since earlier this year, its second economic contraction in just a few years, and unemployment is stubbornly high at close to 25 per cent with a return to job creation still two years away.

Falling tax revenue and rising costs of unemployment benefits are confounding the government's efforts to hit a 2012 deficit reduction target of 6.3 per cent of gross domestic target agreed with the European Union.

In the wake of the downgrade, the euro dropped about 0.25 per cent to $1.2865 in late New York trade from just under $1.29 prior to the news.

"This is weighing on the euro. A downgrade from S&P could be followed by a downgrade from Moody's, and while S&P did not downgrade Spain to junk, Moody's might," said Kathy Lien, managing director at BK Asset Management in New York.

"If Moody's goes to junk status, that's even more significant, and this adds to the pressure on Moody's to make a decision. It could lead to higher bond yields in Spain and push the government closer to asking for a bailout," Lien added.

In European trade earlier on Tuesday, 10-year Spanish bond yields fell 1 basis point to 5.83 per cent. Those yields spiked above 7 per cent earlier this year, but have since slide on a European Central Bank bond-buying plan.