"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 spokeswoman at Spain's Economy Ministry told Reuters the government had no comment on the ratings action.
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 percent 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 percent of gross domestic target agreed with the European Union.
Both the International Monetary Fund and Spain's own Central Bank cast doubt on the savings envisioned in Prime Minister Mariano Rajoy's 2013 budget, saying they are based on a too-rosy outlook for the economy.
In the wake of the downgrade, the euro dropped about 0.25 percent 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, ten-year Spanish bond yields fell 1 basis point to 5.83 percent. Those yields spiked above 7 percent earlier this year, but have since come down on a European Central Bank bond-buying plan.
SOCIAL DISCONTENT AND EURO ZONE DOUBTS
Prime Minister Rajoy's centre-right People's Party has an absolute majority in parliament and so far has been able to pass spending cuts and economic reforms without any problem.
However, street protests have increased in recent months as Spaniards revolt against public sector wage cuts and lower spending on education and healthcare. Resentment is also rising over huge public bailouts for the country's crippled banks, while social benefits are cut.
Although Rajoy's PP governs 11 of 17 Spanish regions, which have been forced to make massive budget cuts, S&P noted that tensions between the central and regional governments are rising, "leading to substantially diluted policy outcomes."
The agency said Rajoy's resolve will be "repeatedly tested by domestic constituencies."
Although the European Central Bank has set up a bond-buying program that would support Spanish debt prices on the secondary market, Spain has balked at signing up for international aid because it would come with harsh conditions.
"We view the Spanish government's hesitation to agree to a formal assistance program ... as potentially raising the downside risks to Spain's rating," S&P said in its note.
The agency also said that euro zone policy makers must show progress on implementing a banking union that would allow Europe to directly recapitalize Spanish banks, taking the weight off of the Spanish government.