FRANKFURT — Greece’s credit rating was lowered to junk status Tuesday by a leading credit agency, a decision that rocked financial markets and deepened fears that a debt crisis in Europe could spiral out of control.

The ratings agency, Standard & Poor’s, downgraded Greece’s long-term and short-term debt to non-investment status and cautioned that investors who bought Greek bonds faced dwindling odds of getting their money back if Greece defaulted or went through a debt restructuring. The move came shortly after S.&P. reduced Portugal’s credit rating and warned that more downgrades were possible.

The downgrades, announced near the end of trading in Europe, came amid rising political tensions across the Continent that had already punished Greek bonds and sent stock prices down sharply from London to Paris to New York. The Dow Jones industrial average slumped by 213.04 points to close at 10,991.99, a fall of 1.9 percent for the day; major indexes in Western Europe fell by 2.5 percent or more. Investors, worried about shock waves in the broader European economy, also migrated away from the euro and pushed the dollar and Treasury bonds higher. The euro slid to $1.3316 in afternoon trading in New York from $1.3382 late Tuesday.

“This is a signal to the markets that the situation is deteriorating rapidly, and it’s not clear who’s in a position to stop the Greeks from going into a default situation,” said Edward Yardeni, president of Yardeni Research. “That creates a spillover effect into Portugal and Spain and raises the whole sovereign debt issue.”