But trading continued at a nervous crawl ahead of Friday's unemployment report, which may provide a clearer indication on the pace of inflation.
The Dow Jones industrial average rose 31.77 to 5,697.48 after meandering higher and lower through the morning and early afternoon, never budging more than 10 points in either direction.
Advancing issues outnumbered decliners by a 13-to-9 margin on the New York Stock Exchange, with 1,406 up, 965 down and 800 unchanged.
NYSE volume totaled 375.38 million shares vs. 384.48 million in the previous session.
Broad-market indexes were mostly higher as interest rates fell in the bond market, but volume continued at an anemic pace.
The NYSE composite index rose 2.58 to 363.38, and the S&P 500 list gained 5.88 to 678.44.
The Nasdaq composite closed ahead 5.80 at 1,249.48, and the American Stock Exchange's market value index rose 0.83 to 608.27.
"The market's entered a pre-unemployment report doldrum," said Dan Ascani, president of Global Market Strategists Inc. in Gainesville, Ga. "Traders are not willing to get caught by this unemployment number. Many were caught with the wrong outlook before the last three reports."
Bonds were mostly unchanged until early afternoon, when the 30-year Treasury bond started rising and its yield dipped to 6.96 percent.