Updated from 10:57 a.m. EDT

Oil prices eked out a modest gain Wednesday after a government report showed gasoline supplies plunged last week.

Inventory fears have recently gripped the energy markets once again, aided by the planned shutdown of

BP's

(BP) - Get Report

Prudhoe Bay oil field in Alaska to fix a corroded pipeline and leak. The country's largest oil field, which accounts for 8% of domestic crude production, is in the process of being shut down and is expected to remain offline until February.

Light, sweet crude added 4 cents to close at $76.35 a gallon on Nymex. The contract hit a high of $77.44 during the day. This week, oil futures have seesawed dramatically between supply fears and assurances there is enough crude to cover peak demand during the summer. On Monday, oil prices rocketed up more than $2 to $76.98 a barrel, but dipped to $76.31 yesterday.

Wholesale gasoline prices closed down 5 cents to $2.17 a gallon, while heating oil lost 1 cent to $2.10 a gallon.

On Tuesday, U.S. Energy Secretary Samuel Bodman said BP may keep the western half of the Prudhoe Bay oil field open while it completes repairs, which BP America President Bob Malone echoed in a conference call with analysts yesterday.

Regardless of the speed of repairs, Bodman said there are adequate domestic inventories and imports to make up the difference. His assurances helped ease worries in the energy markets that there would not be enough gasoline to cover peak demand during the summer driving season.

With those supply fears in mind, traders were focusing particular attention on the U.S. Energy Department's weekly petroleum inventory update, which was released at 10:30 a.m. EDT. Crude stockpiles dropped by 1.1 million barrels to 332.6 million barrels last week, in line with analysts' expectations, courtesy of lower imports and higher gasoline production. Despite the drawdown, domestic supplies are 4.3% above last year's level.

Robust demand and lower imports led gasoline inventories to plunge by 3.2 million barrels for the week ended Aug. 4, more than triple estimates. The decline, which leaves stockpiles 0.8% above the same period last year, seems to put to rest any fears that high gasoline prices would keep Americans from taking summer holidays.

Gasoline prices have risen almost 40% since the start of the year, with the average price for a gallon of regular gasoline hitting $3.038 on Monday. However, an average of 9.6 million barrels of gasoline were used over the past four weeks, 1.8% above last year.

"The villain once again is strong apparent demand for gasoline. This remains as puzzling as ever, given the recent uptick in gasoline prices," wrote Rakesh Shankar, an energy analyst with Moody's

Exonomy.com

in a client note. "Clearly, the increase in production was just not enough to cope with the surge in demand."

Refiners ramped up production of gasoline last week to meet demand, and their capacity rose in tandem to 91.6%, up from 90.8% the previous week.

Distillates dropped by 200,000 barrels last week thanks to rising demand.

Natural gas added 49 cents to $7.65 per million British thermal units in expectation of flat storage levels in the Energy Department's supply report Thursday. Supplies are currently 15% above last year's levels, and 19% above the five-year average. Natural gas is used by many utilities to generate power. In a

Bloomberg

poll of energy analysts, inventories were expected to remain the same.

Flat storage levels would be a surprise, because scorching temperatures in the Northeast drove electricity usage up last week.

In market action, oil stocks were mixed, with the Amex Oil Index up around 1% and the Philadelphia Oil Service Index down 1%.

HESS

(HES) - Get Report

,

ConocoPhillips

(BP) - Get Report

and

Total

(TOT) - Get Report

were leading advancers among oil drillers and refiners.

Among oil-service companies,

Transocean

(RIG) - Get Report

,

Cameron International

(CAM)

and

Schlumberger

(SLB) - Get Report

were losing the most, down around 1%.

BPwas still recovering from its $2-plus plunge on Monday, recently up 73 cents, or 1.1%, to $70.28.

Exxon Mobil

(XOM) - Get Report

and ConocoPhillips, which each have a 36% stake in the Prudhoe Bay oil field, were adding 25 cents to $69.52, and $1.32 to $68.95, respectively.