Socks gained on Monday, but the day's rally was dampened by news that Germany and other top-rated European nations could see their credit ratings cut.

Stocks have tied their fortunes to a hoped-for resolution of the European debt crisis. Optimistic investors bought shares in the morning after French President Nicolas Sarkozy said Germany and France had come to an agreement on tighter fiscal controls for the euro zone, to be voted on Friday.

But the Financial Times and other reports of potential downgrades for every euro-zone nation hit markets hard by late afternoon, erasing part of the day's gains.

After the market's close, Standard & Poor's placed the sovereign ratings of Germany, France and other euro zone nations on credit watch negative, the step that precedes a downgrade. Stock index futures edged lower after the news.

The market felt in some ways it was past these worries for the time being, and now they'll have to revisit them, or at least churn them over in their minds, said Bruce Zaro, chief technical strategist at Delta Global Asset Management in Boston.

Markets have struggled with the euro zone's crisis for months. Hope that European policymakers were entering an endgame sent the S&P 500 to its best week in almost three years last week with a rise of 7.4 percent.

The S&P financial sector <.GSPF>, up 2.1 percent, still led gains for the day. Shares of Citigroup rose 5.9 percent to $29.83, while shares of Morgan Stanley gained 6.8 percent to $16.57.

The Dow Jones industrial average <.DJI> was up 78.41 points, or 0.65 percent, at 12,097.83. The Standard & Poor's 500 Index <.SPX> was up 12.80 points, or 1.03 percent, at 1,257.08. The Nasdaq Composite Index <.IXIC> was up 28.83 points, or 1.10 percent, at 2,655.76.

All three indexes were trading well above 1 percent around midday.

After the close, stocks futures inched lower with the announcement of the possible downgrades euro zone nations. S&P 500 futures slipped 0.5 point and were about even with fair value.

At this point I can't say anybody would be surprised. All of these governments have fairly significant debt as a percentage of their GDPs, said Fred Dickson, chief market strategist at the Davidson Cos. in Lake Oswego, Oregon.

Still, investors are hoping the EU agreement will pave the way for the European Central Bank to buy large amounts of government bonds.

Among other gainers, MetLife Inc's stock advanced 3.7 percent to $32.92 after the largest U.S. life insurer forecast 2012 earnings growth of as much as 7 percent, though its fourth-quarter outlook was below expectations.

Shares of SuccessFactors surged 51 percent to $39.75 after Germany's SAP announced a $3.4 billion cash deal to buy the Web-based software company.

About 7.18 billion shares traded on the New York Stock Exchange, NYSE Amex and Nasdaq, below the current daily average of 7.96 billion shares traded per day.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of about 4 to 1 and on the Nasdaq by about 9 to 4.

(Reporting by Caroline Valetkevitch; Editing by Kenneth Barry)