NEW YORK - Oil prices bolted up a stunning 8 percent yesterday, an unprecedented rise that will mean more bad news at the gas pump for motorists this summer.

The immediate cause of yesterday's increase was a forecast by the Wall Street firm Morgan Stanley that oil would hit $150 a barrel by the Fourth of July. But the price also had risen Thursday, making the two-day gain the largest in the history of the New York Mercantile Exchange, where the commodity is traded.

"We're into uncharted territory, and somewhat off the map as far as historical precedents are concerned," said Jim Ritterbusch, president of the energy consultancy Ritterbusch & Associates in Galena, Ill.

The oil-price increase, also attributed to rising tensions in the Middle East, raised the prospect of accelerating inflation by adding to strained transportation costs.

That gloomy outlook sent stocks tumbling, taking the Dow Jones industrial average down nearly 400 points.

On the New York Merc, light, sweet crude for July delivery rose as high as $139.12 before easing slightly. The price settled at a record $138.54 a barrel, up $10.75 for the day. The highest previous close was $135.09 a barrel on May 22.

The combined increase over the last two days was $16.24 a barrel, or more than 13 percent.

At the pump, motorists in Philadelphia and its four suburban counties in Pennsylvania paid an average of $4.05 a gallon yesterday, up a penny from Thursday and 40 cents in a month, AAA Mid-Atlantic said.

In the three suburban South Jersey counties, yesterday's average was unchanged at $3.88 a gallon. That was 39 cents more than a month ago.

The nationwide average was $3.99 a gallon, up a penny from Thursday, AAA said.

James Cordier, president of the Tampa, Fla., firm Liberty Trading Group, predicted gasoline prices could hit a national average of $4.25 a gallon as early as the end of June. "Unfortunately, drivers cutting back isn't going to lower the price of gasoline anytime soon," he said.

Oil prices pushed sharply higher yesterday after Morgan Stanley analyst Ole Slorer predicted that strong demand in Asia could drive prices to $150 by Independence Day, when millions of Americans are expected to take to the roads.

Slorer said shipments from the Middle East were mimicking patterns seen in the third quarter last year, when Morgan Stanley based a prediction of an oil-price spike on falling supplies in the Atlantic. "We made the same call using the same parameters, but now we are starting from much lower inventory levels," Slorer said.

Traders also zeroed in on remarks by an Israeli cabinet minister, who was quoted as saying his country would attack Iran unless Tehran abandoned its nuclear program. Transportation Minister Shaul Mofaz also said that Iranian President Mahmoud Ahmadinejad "will disappear before Israel does," the Yedioth Ahronoth daily reported. Iran is the second-biggest producer in the Organization of Petroleum Exporting Countries, and traders worry that any conflict with Israel could disrupt global supplies.

A further weakening of the dollar also helped send oil prices higher by enticing overseas buyers armed with stronger currencies and others looking for a hedge against the U.S. currency. In addition, some analysts said the threat of a strike by Chevron Corp. workers in Nigeria could lead to considerable shutdowns of Nigerian production. A similar strike by Exxon Mobil Corp. workers last April, which lasted a week, reduced Nigerian output 800,000 barrels a day, or nearly a third of the country's daily exports.

A strike might delay the start of Chevron's 250,000-barrels-a-day Agbami project, the country's largest offshore oil venture, which is scheduled for June 15.

Yesterday's big increase also represented a stampede by traders and optimistic computer models betting that oil prices still have further to rise.

The strong volatility in energy markets in recent weeks has continued to puzzle investors and traders. Prices keep going up despite a lack of shortages in the market and strong evidence of lower consumption in industrialized countries.

Investors seem to be caught in a bullish mood, focusing instead on perceived risks to future oil supplies and continued growth in demand from emerging economies.

One view that has been gaining ground in recent months is that the commodity market is caught in a speculative bubble akin to the technology bubble of the late 1990s. That theory was raised by politicians in Washington and a slew of OPEC producers, who blame speculators for the staggering oil rally.