NEW YORK - Oil prices soared Thursday as the dollar swooned and prices at the pump in the United States edged to within a penny of US$4 a gallon.

Light, sweet crude for July delivery rose as high as $128.26 before easing to settle up $5.49 at $127.79 on the New York Mercantile Exchange. It was the biggest single-day price increase in the history of the Nymex crude contract, though larger one-day percentage jumps have taken place in the past.

Crude's surge came as the dollar fell in response to comments by European Central Bank president Jean-Claude Trichet suggesting the bank could raise interest rates. He spoke after the bank left a key interest rate unchanged amid concerns about inflation. While Trichet said a change in rates was not a certainty, he said some of the bank's governors favour an increase.

"Oil, which was very weak, rallied on those comments,'' said Phil Flynn, an analyst at Alaron Trading Corp. in Chicago. "They're out of step with the U.S., which is weakening the dollar.''

When rates rise in Europe, or fall in the U.S., the dollar tends to weaken against the euro. Many investors buy commodities such as oil as a hedge against inflation when the dollar is falling. Also, a weaker greenback makes oil less expensive to investors dealing in other currencies.

Many analysts believe the dollar's protracted decline has been a major reason why oil prices have nearly doubled from year-ago levels. Oil's rally has pushed gas prices to record levels.

Earlier this week, U.S. Federal Reserve chairman Ben Bernanke indicated that more interest rate cuts are unlikely in the U.S. Bernanke's comments sent the dollar higher, helping push oil prices lower.

The average national price of a gallon of gas rose 0.6 cent overnight to a record $3.989, according to a survey of stations by AAA and the Oil Price Information Service. Prices have not fallen since May 6, AAA records show, and are likely to continue rising for at least a while before eventually turning lower.

"We may still get to $4 in the next couple of days, but I do think ... it's just a matter of time before the retail price starts to stall and maybe move lower,'' said AAA spokesman Geoff Sundstrom.

Gas prices are higher than $4 in many parts of the country, and average more than that in 13 states and the District of Columbia.

The price in Canada was averaged C$1.33418 per litre, according to price-watching web site Gasbuddy.com.

Diesel prices are already falling; the average national price of a gallon of diesel in the United States slid 0.8 cent overnight to $4.77, according to AAA and OPIS, though prices are above $5 a gallon in some areas. Diesel prices peaked at a record $4.792 on May 30, and have risen $1.87 in a year due mostly to rising demand for the fuel in the developing world. High diesel prices have boosted prices of food and consumer goods transported by truck, ship and rail, putting additional pressure on families already struggling with $4 gas.

Oil's decline since May 22 has come largely on concerns about demand. Recent Energy Department data shows high prices have led consumers to cut their gasoline consumption. Meanwhile, many Asian nations are cutting fuel subsidies, effectively raising prices. Automakers are cutting production of gas-guzzling SUVs and trucks, and airlines are cutting capacity, both due to high fuel prices.

"There's a lot of empirical evidence that demand has plateaued,'' Sundstrom said.

Still, gasoline refiners, wholesalers and retailers are feeling pressure to keep prices high, for now. Crude prices have risen 89 per cent in the past year, while gas prices are up only 27 per cent. That discrepancy has pressured profit margins along the gasoline supply chain; falling demand has prevented gas suppliers from raising prices as much as they would like.

In many cases, retailers are selling gas at a loss, relying on sales of convenience store items to generate income, analysts say.

"One would have to think that they're very reluctant to bring down the price of gas when their overall business is under pressure,'' Sundstrom said.

Oil's surge pulled other energy futures sharply higher Thursday. In other Nymex trading, July gasoline futures rose 13.94 cents to settle at $3.3345 a gallon while July heating oil futures rose 13.5 cents to settle at $3.6808 a gallon.

July natural gas futures rose 14 cents to settle at $12.519 per 1,000 cubic feet. The Energy Department said natural gas inventories rose by 105 billion cubic feet last week, near the high end of the range of analyst estimates.

In London, July Brent crude futures rose $5.44 to settle at $127.54 a barrel on the ICE Futures exchange.