Updated from 3:59 p.m. EDT

Shares of major oil companies were mostly positive on Tuesday, as the overall stock market moved higher.

Light, sweet crude oil futures for May delivery finished down $1.27, or 2.6%, to $48.39 a barrel on the New York Mercantile Exchange.

Crude inventories rose more than expected last week, and gasoline stockpiles increased despite analysts' predictions for a steep drop, as demand for motor fuel fell slightly, according to government data released Wednesday.

For the week ended March 27, crude inventories rose by 2.8 million barrels, or 0.8 percent, to 359.4 million barrels, which is 15.5% above year-ago levels, the Energy Department's Energy Information Administration said in its weekly report.

Analysts expected a boost of 3.2 million barrels, according to a survey by Platts, the energy information arm of McGraw-Hill Cos.

The Amex Oil index finished at 867.46, up 16.39 or 1.93%.

ConocoPhillips ( COP) closed at $39.80, up 64 cents or 1.63%.E.L. (Gene) Batchelder, currently senior vice president, services, and chief information officer, will become senior vice president and chief administrative officer. Batchelder will be responsible for the strategy, leverage and oversight of global shared services, human resources, facilities, information technology, security, aviation, executive services, and corporate affairs, which includes investor relations, corporate communications and contributions.

Chevron ( CVX) was up just under 1%, or 65 cents to $67.89.

BP ( BP) closed at $40.42, up 32 cents or 0.8%.

Royal Dutch Shell ( RDS.B) closed at $44.09, up 48 cents or 1.10%.

Exxon Mobil ( XOM) shares finished at $69.23, up $1.13 or 1.66%.

Gasoline inventories rose by 2.2 million barrels, or 1%, to 216.8 million barrels, which is 1% above year-ago levels. Analysts expected stockpiles to fall by 1.8 million barrels.

Demand for gasoline over the four weeks ended March 27 was 0.2% lower than a year earlier, averaging 9 million barrels a day.

U.S. refineries ran at 81.7% of total capacity on average, a drop of 0.3 percentage point from the prior week. Analysts expected capacity to rise 0.2 percentage point to 82.2%.

After the report was released, light, sweet crude fell $1.31 to $48.35 per barrel on the Nymex.^XOI 5:01pm ET 867.46 Up 16.39 Up 1.93% 0 Chart, more...- - - - - BP 4:00pm ET 40.42 Up 0.32 Up 0.80% 6,414,351 Chart, Message, Profile, more...- - - - - COP 4:02pm ET 39.80 Up 0.64 Up 1.63% 15,444,797 Chart, Message, Profile, more...- - - - - CVX 4:00pm ET 68.30 Up 1.06 Up 1.58% 14,298,753 Chart, Message, Profile, more...- - - - - PTR 4:01pm ET 80.98 Up 1.28 Up 1.61% 1,162,261 Chart, Message, Profile, more...- - - - - PZE 4:01pm ET 5.73 Up 0.04 Up 0.70% 219,089 Chart, Message, Profile, more...- - - - - RDS-B 4:03pm ET 44.09 Up 0.48 Up 1.10% 445,112 Chart, Message, Profile, more...- - - - - REP 4:01pm ET 17.63 Up 0.54 Up 3.16% 337,999 Chart, Message, Profile, more...- - - - - TOT 4:02pm ET 49.51 Up 0.45 Up 0.92% 2,441,765 Chart, Message, Profile, more...- - - - - XOM 4:00pm ET 69.23 Up 1.13 Up 1.66% 39,367,114 Chart, Message, Profile, more...^XOI 5:01pm ET 867.46 Up 16.39 Up 1.93% 0 Chart, more...- - - - - BP 4:00pm ET 40.42 Up 0.32 Up 0.80% 6,414,351 Chart, Message, Profile, more...- - - - - COP 4:02pm ET 39.80 Up 0.64 Up 1.63% 15,444,797 Chart, Message, Profile, more...- - - - - CVX 4:00pm ET 68.30 Up 1.06 Up 1.58% 14,298,753 Chart, Message, Profile, more...- - - - - PTR 4:01pm ET 80.98 Up 1.28 Up 1.61% 1,162,261 Chart, Message, Profile, more...- - - - - PZE 4:01pm ET 5.73 Up 0.04 Up 0.70% 219,089 Chart, Message, Profile, more...- - - - - RDS-B 4:03pm ET 44.09 Up 0.48 Up 1.10% 445,112 Chart, Message, Profile, more...- - - - - REP 4:01pm ET 17.63 Up 0.54 Up 3.16% 337,999 Chart, Message, Profile, more...- - - - - TOT 4:02pm ET 49.51 Up 0.45 Up 0.92% 2,441,765 Chart, Message, Profile, more...- - - - - XOM 4:00pm ET 69.23 Up 1.13 Up 1.66% 39,367,114 Chart, Message, Profile, more...

Copyright 2009 TheStreet.com Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed. AP contributed to this report.

More from Investing

Video: Jim Cramer on the Markets, Oil, General Electric, Zillow and Micron

Video: Jim Cramer on the Markets, Oil, General Electric, Zillow and Micron

Kroger CEO: Even in the Age of Amazon, Physical Stores Will Still Be Important

Kroger CEO: Even in the Age of Amazon, Physical Stores Will Still Be Important

Video: As Trade Worries Subside, Expect a 'Relief Rally' in Stocks

Video: As Trade Worries Subside, Expect a 'Relief Rally' in Stocks

Micron Shares Soar; Chipmaker Is 'Managing for Profitability' Now, Says Analyst

Micron Shares Soar; Chipmaker Is 'Managing for Profitability' Now, Says Analyst

Big Banks' Shift to Digital Could Bring These Significant Shareholder Benefits

Big Banks' Shift to Digital Could Bring These Significant Shareholder Benefits