Stocks rose on Wednesday, shaking off a slide in China's equity market, as investors responded favorably to a surprising drop in crude oil stockpiles that might suggest an improving demand outlook.

Exxon Mobil Corp and Chevron Corp , both Dow components, led the blue-chip Dow industrials' advance. Exxon Mobil was up 2.3 percent at $68.00, and Chevron gained 1.8 percent to $68.16.

Murphy Oil Corp was also up 3.1 percent at $58.05 and the S&P Energy Index <.GSPE> gained 1.9 percent.

U.S. front-month crude oil rose 4.7 percent, or $3.23, to settle at $72.42 a barrel after a report showed the biggest drop in inventories since May.

Wall Street had opened lower after the Shanghai Composite index <.SSEC> fell to a two-month low as investors fretted that China's 20 percent slide over the past two weeks would continue.

We see more people shrugging off overseas weakness and putting money into equities here, not wanting to see the stocks come down, said Michael James, senior trader at Wedbush Morgan in Los Angeles.

Firmer oil prices are helping the overall equities market, but there is a positive bias toward equities to begin with.

The Dow Jones industrial average <.DJI> gained 61.22 points, or 0.66 percent, to end at 9,279.16. The Standard & Poor's 500 Index <.SPX> rose 6.79 points, or 0.69 percent, to 996.46. The Nasdaq Composite Index <.IXIC> advanced 13.32 points, or 0.68 percent, to 1,969.24.

After the closing bell, shares of NetApp Inc fell 3.7 percent to $22.05 after the company reported its fiscal first-quarter results. The data storage equipment maker's stock closed on Nasdaq at $22.89, up just 4 cents, or 0.2 percent, before the earnings were released.

During the regular session, healthcare stocks also outperformed the broader market. Shares of Merck & Co led the healthcare sector's advance. The drugmaker's stock was up 2.5 percent at $31.48. Shares of rival drugmaker Pfizer Inc
added 2.4 percent to $16.37.

But the tech-heavy Nasdaq's climb was curbed by Hewlett-Packard Co , which was down 0.3 percent at $43.83 on the NYSE after the computer and printer maker expressed caution about business demand late on Tuesday. Earlier, H-P hit an intraday low at $42.52.

Another speed bump for the market was courtesy of Deere & Co , which shed 2.9 percent to $43.78 after the U.S. tractor and farm equipment maker said it expected to barely break even in the fourth quarter.

With many traders on vacation, volume was light on the New York Stock Exchange, with only about 988 million shares changing hands, sharply below last year's estimated daily average of 1.49 billion.

On the Nasdaq, about 1.99 billion shares traded, also below last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of about 3 to 2, while on the Nasdaq, about 17 stocks rose for every nine that fell.

(Editing by Jan Paschal)