Stocks bounced off session highs on Wednesday after investors shrugged off a downgrade of Portugal's credit rating and an interest-rate hike in China.

Transports ranked among the top advancers as the Dow Jones Transportation Average <.DJT> rose 1.4 percent to an all-time high. The index was led by Con-Way Inc , whose shares gained 5.7 percent to $41.89 after the U.S. trucking and logistics company said it was restoring some employee benefits because the economy had improved.

But gains were modest as a softer-than-expected survey on U.S. services sector growth, which slowed slightly in June, gave investors little reason to make big bets after last week's 5.6 percent rally.

Banks were among the worst performers on concerns about their exposure to euro-zone debt and sluggish U.S. growth. The KBW Bank Index <.BKX> fell 0.8 percent, with JPMorgan Chase & Co off 1.2 percent to $40.52.

Any time you are dealing with banking issues, there seems to be domino effect, said Steve Goldman, market strategist at Weeden & Co. Goldman said he is expecting last week's rally to be supported after a period of consolidation.

The S&P 500 has been fluctuating in a range from about 1,250 to 1,350 for the last several months, with flare-ups in the euro-zone debt crisis often serving as a catalyst for profit-taking in a short-term trader's market.

The Dow Jones industrial average <.DJI> gained 55.13 points, or 0.44 percent, to 12,625.19. The Standard & Poor's 500 Index <.SPX> added 1.01 points, or 0.08 percent, to 1,338.89. The Nasdaq Composite Index <.IXIC> rose 8.14 points, or 0.29 percent, to 2,833.91.

In early afternoon trading, all three major U.S. stock indexes briefly touched session highs.

Moody's downgrade of Portugal's credit rating on Tuesday to junk cast new doubt on European efforts to rescue distressed euro-zone states without debt restructuring.

Reflecting concerns about the euro-zone debt crisis, the iShares MSCI Italy index fell 3 percent and the iShares MSCI Spain index lost 2 percent.

China's central bank increased interest rates for the third time this year on Wednesday, making clear that taming inflation is a top priority as its economy slows gently.

The Institute for Supply Management services index showed the pace of growth in the U.S. services sector dipped modestly in June, while prices paid fell sharply to the lowest level since August 2010.

Volume has been light, a trend expected to continue in the holiday-shortened week, and could keep trading choppy.

(Reporting by Edward Krudy; Editing by Jan Paschal)