Stocks closed higher after faltering for awhile on a Federal Reserve report that the economy will remain weak due largely to unemployment.
Major indexes regained most of the ground they lost when the Fed's Beige Book called its outlook "cautiously positive" but noted a generally pessimistic mood regarding car sales and commercial real estate.
Investors responded by retreating from positions in a market that was lifted through most of the day by strength in commodities, industrials and technology.
The Fed's report was somewhat at odds with a growing consensus that the economy is out of recession and on the path to recovery.
"The US manufacturing sector expanded in August, the first month of expansion since January 2008," noted analysts at Bank of America-Merrill Lynch Securities in a research note. "We believe this rebound represents the leading edge of the US recovery. It is consistent with our view that Q2 will mark the last quarter of negative growth in this economic cycle before the economy begins to expand driven by inventories, housing and trade."
The market trimmed gains in crude oil , which at one point was above $72, and gold , which waffled around the $1,000 mark.
The Nasdaq also trimmed gains when Apple turned negative following a product launch event that featured a speech from founder Steve Jobs.
The tech index had been up more than 1 percent earlier as Vivus soared after the company said a trial found that patients on the company's obesity drug, Qnexa, lost 14.7 percent of their body weight.
Starbucks was among the index's leading advancers after the coffee store chain said it had decided to take 30 stores off a closure list after the locations posted stronger sales.