The stock market extended a streak of erratic trading Wednesday, rebounding from early losses and rising moderately after a drop in oil inventories lifted hopes for an economic recovery.
All of the major stock indexes finished with gains of less than 1%.
The day began with a sharp slide driven by a plunge in China's biggest stock market and followed a trading pattern seen in markets around the world this week. Stocks have alternately advanced and retreated as investors shuttle between worries about the economy's challenges, namely consumer spending and high unemployment, and nascent signs of healing.
While the surprising decline in crude inventories was reassuring, there is still plenty of caution among investors. Even as stocks recovered, Treasury prices held on to most of their gains. Government debt is a safe-haven investment in a struggling economy.
News from the Energy Department that the nation's oil inventory fell by more than 8 million barrels in the past week sent oil prices and then stocks higher, as investors bet that the decline in stockpiles is an indication that energy demand is rising and the economy is improving.
Stocks' sharp turn shows just how sensitive investors are to the latest bits of news, hungry for any positive signs about the economy and confirmation that the more than 40% surge in stocks since March has been warranted.
Analysts say the financial markets are likely to bounce around in the near term as investors try to reconcile their hopes for an economic recovery with the reality that it might not come as fast or be as strong as many people expected.
"Volatility is creeping up," said Brian Nick, investment strategist at Barclays Wealth. "For a while we were seeing volatility steadily declining and maybe we thought we were completely out of the woods when we were not completely out of the woods."
The Dow Jones industrials rose 61.22, or 0.7%, to 9,279.16. The Standard & Poor's 500 index rose 6.79, or 0.7%, to 996.46, while the Nasdaq composite index rose 13.32, or 0.7%, to 1,969.24.
About three stocks rose for every two that fell on the New York Stock Exchange, where volume came to a light 4.35 billion shares, up from Tuesday's 4.28 billion.
The Russell 2000 index of smaller companies rose 5.22, or 0.9%, to 561.65.
The yield on the benchmark 10-year Treasury note, which moves opposite its price, fell to 3.46% from 3.52% late Tuesday. It was trading at about 3.44% before the oil report.
Light, sweet crude jumped $3.23 to $72.42 a barrel on the New York Mercantile Exchange.
Analysts said Wall Street's gains on Wednesday were likely magnified by short-covering, in which investors have to buy stock after having earlier sold borrowed shares in a bet they would fall. That rush to cover ill-timed bets can quicken the market's climb.
At the same time, money managers and investors are still afraid of missing out on a rally that began last March and has continued despite period setbacks.
"I think people would like to buy (stocks) lower, but as the market creeps higher, people are kind of forced to buy," said Nick Kalivas, vice president of financial research at MF Global. "The action today especially has been much stronger than I would hope and it is making me nervous about my bearish view."
Still, the advance in bond prices is one sign that investors don't feel secure.
"There's this pushing and pulling type of action because people aren't so convinced that the consumer is going to come out and induce some spending because obviously employment remains weak," said Robert Pavlik, chief market strategist at Banyan Partners.
In earnings news, BJ's Wholesale Club said its second-quarter profit dipped 4% and sales declined because of falling gasoline prices. Still, the warehouse club's results beat analysts' estimates and it raised its full-year profit outlook. It rose 67 cents, or 2.1%, to $31.99.
Deere, the world's largest maker of farm equipment, reported a 27% drop in its fiscal third-quarter profit, but also did better than Wall Street expected. Deere tumbled $1.31, or 2.9%, to $43.78.
Hewlett Packard slipped 13 cents to $43.83 after the company said late Tuesday its profit fell 19% in the latest quarter on weak sales. However, the computer company provided an outlook for the fiscal fourth quarter that was better than expected.
Merck rallied after a federal judge ruled in favor of the drugmaker in a patent fight with an Israeli company that wants to sell a generic version of its top-selling asthma drug. Shares rose 77 cents, or 2.5%, to $31.48.
Among energy stocks, Murphy Oil . jumped $1.73, or 3.1%, to $58.05, while ExxonMobil rose 2.3%, adding $1.51 to $68.
The dollar was mixed against other major currencies. Gold prices rose, while other metals prices fell.
Overseas, Japan's Nikkei stock average fell 0.8%. Britain's FTSE 100 recovered from early losses to finish up 0.03%. Germany's DAX index slipped 0.2%, while France's CAC-40 fell 0.1%.
The Shanghai index plunged 4.3%, after being down as much as 5%. The index has lost nearly 20% this month on worries about the strength of China's recovery and a possible clamp on Beijing's easy credit policy that helped to fuel the rally in Chinese stocks earlier this year.