NEW YORK — Oil prices regained their stunning upward momentum Wednesday, rising as crude's biggest drivers — a weak dollar and supply concerns — brought buyers back in force. At the pump, gas prices rose to a new record over $4.05 a gallon.

Oil futures that were falling a week ago on concerns about declining gasoline consumption have dramatically reversed course and appear poised to set new records above $140 a barrel. While the market remains concerned about the effect of high prices on demand, several weeks of falling oil inventories and the dollar's inability to make headway against the euro have combined to turn market sentiment decidedly bullish.

That's bad news for consumers, already struggling with rising prices for food and consumer goods. Analysts say gas prices could rise to a national average of $4.25 a gallon by the Fourth of July, and are unlikely to fall as long as oil prices keep surging.

On Wednesday, the Energy Department's Energy Information Administration created new supply worries when it said oil inventories fell by 4.6 million barrels last week. Analysts surveyed by energy research firm Platts expected a much smaller decline of about 1.4 million barrels; any sign that oil supplies are falling has tended to send oil climbing.

Light, sweet crude rose $5.07 to settle at $136.38 a barrel on the New York Mercantile Exchange after earlier trading as high as $138.30. Oil surged shot up more than $16 over the course of last Thursday and Friday, reaching a trading record of $139.12 before pulling back earlier this week.

The dollar's travails also sent oil prices rising. The euro bought $1.5562 in late afternoon trading, up from $1.5449 Tuesday. Oil prices have closely tracked dollar moves; last week's sharp price increases came as the dollar fell. Prices then retreated more than $7 earlier this week as the dollar gained ground.

"(Oil's) been hand in hand with what the dollar's been doing," said James Cordier, president of Tampa, Fla.-based trading firms Liberty Trading Group and OptionSellers.com.

Many investors buy commodities such as oil as a hedge against inflation when the dollar falls. Also, a weaker greenback makes oil less expensive to investors dealing in other currencies. Many analysts believe the dollar's protracted decline is the primary reason oil prices have doubled over the past year.

Energy investors are betting that the European Central Bank will raise interest rates later this summer, and that the U.S. Federal Reserve will hold rates steady until this fall, Cordier said. If rates rise in Europe but remain unchanged in the U.S., the dollar will likely fall further against the euro.

"That's going to really fuel the (investment) funds back into the long side of crude oil," Cordier said.

Other elements of the EIA's report were considered bearish for prices. Supplies of gasoline and distillate fuels such as diesel and heating oil both rose last week, and demand for gasoline fell by 1.3 percent.

But traders chose to focus on the big drop in crude supplies and the weaker dollar, propelling prices higher. Crude inventories have fallen by 23.6 million barrels over the past four weeks.

"If crude inventories were seriously in surplus, I think that would start to override the effects of the dollar," said Michael Lynch, president of Strategic Energy & Economic Research Inc. in Winchester, Mass.

Retail gas prices, meanwhile, reached another record Wednesday, rising 0.9 cent overnight to a national average of $4.052, according to a survey of stations by AAA and the Oil Price Information Service. Prices continue rising, despite falling demand, because the price of oil keeps moving higher.

While oil prices have slipped some from last week's record, analysts say gas prices still have some catching up to do, and could rise another nickel or so. Of course, if oil futures blast past that record and reach new highs, gas prices will likely rise even higher.

EIA chief Guy Caruso on Wednesday said motorists should expect gasoline prices to remain close to $4 a gallon through next year. On Tuesday, the EIA predicted that gas pries will peak at a monthly average price of $4.15 in August. Cordier thinks gas prices could reach $4.25 by the Fourth of July if oil remains near $140 a barrel.

Diesel prices are also soaring, and rose to a new record of $4.792 a gallon on Wednesday. Rising diesel prices are pushing up prices of food and consumer goods transported by train, truck and ship. The combination of high fuel and food prices is putting intense pressure on many consumers, and raising the prospects of a severe economic slowdown.

Oil prices were also supported Wednesday by reports that Chinese fuel imports rose more than expected over the first 5 months of the year, and Royal Dutch Shell PLC's decision to extend force majeure on some Nigerian oil shipments. The legal declaration that means the company can't meet contractual obligations to supply some customers. The company first made the declaration following a militant attack in April.

In other Nymex trading Wednesday, July gasoline futures rose 14.65 cents to settle at $3.4658 a gallon, and July heating oil futures rose 16.24 cents to settle at $3.9748 a gallon. July natural gas futures rose 22.5 cents to settle at $12.66 per 1,000 cubic feet.

In London, July Brent crude rose $4 to settle at $135.02 a barrel on the ICE Futures exchange.


Associated Press Writer H. Josef Hebert, in Washington, contributed to this report.