LONDON — Europe's government debt crisis worsened ominously Tuesday when two financially troubled countries — Greece and Portugal — saw their credit ratings downgraded as markets sold off their debt. Stocks slid on the news.

Greece was downgraded to junk status by Standard & Poor's, which lowered Portugal's rating as well. The downgrades come as Greece is appealing for euro45 billion in bailout loans from other eurozone governments and the International Monetary Fund.

The bailout was intended to shore up Greece and keep the debt crisis from getting out of control. But Germany wants to see stringent conditions before shouldering the lion's share of the bailout loans — and that has send shudders through markets that the money may not reach Greece in time for a May 19 debt repayment date.

A debt downgrade immediately preceded Greece's call for help last week. While Portugal has less debt, economists have focused on it as the next possible victim if concerns over high levels of government debt in Europe spread.

The downgrade deprives Greece of an investment-grade rating on its bonds, meaning it would pay higher costs to borrow if it taps debt markets again. The agency said Greece's weak long-term growth prospects made it less credit worthy.

"The downgrade results from our updated assessment of the political, economic, and budgetary challenges that the Greek government faces in its efforts to put the public debt burden onto a sustained downward trajectory," said Standard & Poor's credit analyst Marko Mrsnik.

"We believe that the government's policy options are narrowing because of Greece's weakening economic growth prospects, at a time when pressures for stronger fiscal adjustment measures are rising."