Standard & Poor's has downgraded Spain's credit rating two notches to the agency's lowest investment-grade level.
S&P said it lowered its rating on debt issued by Spain from BBB+ to BBB-.
It also assigned a negative outlook to the rating, meaning it could be further downgraded.
S&P cited Spain's economic recession, high unemployment and social unrest. It said those factors are limiting the government's policy options. Spain's economy is shrinking and its banks are struggling under the weight of a collapsed property market.
The European Central Bank has agreed to buy Spanish government bonds to help lower borrowing costs. But the government first needs to apply for a bailout.
The move by Standard & Poor's leaves Spain's rating on the cusp of junk status. S&P also assigned a negative outlook to the rating, saying it could be further downgraded if Spain's economic conditions erode further.
"Overall, against the backdrop of a deepening economic recession, we believe that the government's resolve will be repeatedly tested by domestic constituencies that are being adversely affected by its policies," S&P said.
It also cited difficulty in predicting the extent to which other countries in the 17-nation eurozone would come to Spain's aid. It had previously assumed a key European bailout fund would help recapitalise the country's shaky banks without piling more debt on the central government in Madrid, but now any recapitalisation plan is likely to add more debt, S&P said.
Investors are worried that Spanish banks could collapse under the weight of an imploding property market.
Tensions between Spain's indebted regional governments and the central government were also cited by S&P for its downgrade. S&P estimates Spain's economy will contract by 1.8% this year and another 1.4% next year. Spanish unemployment is near 25%.