NEW YORK — Oil prices finished about where they began Wednesday after jumping more than $2 earlier on reports of lower U.S. oil stockpiles and an Iranian missile test.

Light, sweet crude for August delivery rose a penny to settle at $136.05 a barrel on the New York Mercantile Exchange, but prices shifted between positive and negative territory as traders parsed details of the inventory report following its midmorning release. In aftermarket trading, oil prices fell 40 cents to $135.64 a barrel.

The moves follow two days of steep declines that left prices 6.4 percent below last week's record high.

Figures from the Energy Information Administration showed U.S. oil supplies fell by 5.9 million barrels last week, a decline of 2 percent. That is far above the 1.9 million barrels forecast by analysts surveyed by the energy research firm Platts.

Prices often rise in response considerably to large drops in U.S. oil supplies. But Jim Ritterbusch, president of energy consultancy Ritterbusch and Associates, noted that much of this week's inventory decline was concentrated on the West Coast and was not representative of supplies overall.

"Whenever it's out on the West Coast region, the impact is blunted appreciably," he said.

In addition, gasoline stockpiles rose more than expected, partly offsetting the decline in crude. Inventories of distillate fuel, which include diesel and heating oil, also rose, but less than analysts anticipated.

Retail gasoline prices in the U.S. hovered at a record high just shy of $4.11 a gallon for the third straight day, according to auto club AAA, the Oil Price Information Service and Wright Express. Diesel prices at the pump rose by more than half a penny to a new high of $4.813 a gallon.

Prices rose as high as $138.28 earlier in the day following reports that Iran's elite Revolutionary Guards fired missiles during war games that officials said were meant to show that the key oil producer can retaliate against a U.S. or Israeli attack, state television reported.

The barrage was said to include a new version of the Shahab-3 missile, which officials have said has a range of 1,250 miles. That makes it capable of striking Israel, Turkey, the Arabian peninsula, Afghanistan and Pakistan.

Gen. Hossein Salami, a top commander, was quoted as saying the exercise "is to demonstrate our resolve and might against enemies who in recent weeks have threatened Iran with harsh language."

A day earlier, Iranian President Mahmoud Ahmadinejad dismissed fears that Israel and the United States could be preparing to attack his country, calling the possibility a "funny joke."

"Iran is certainly sending mixed signals," said Victor Shum at Purvin & Gertz in Singapore. "There was an apparent easing of tensions, but then the missile tests had an impact on prices today."

Iran is the world's fourth-largest oil producer and OPEC's second-largest exporter. Oil traders fear any military conflict could prompt Iran to block the Strait of Hormuz, a passageway that handles about 40 percent of the world's tanker traffic.

The declines earlier in the week dragged crude prices back to levels not seen since June 26. However, a number of analysts have cautioned that the sell-off might not represent a long-term shift in the bull ran that just last week drove prices past $145 a barrel.

In Washington, House Speaker Nancy Pelosi called on President Bush to open up the country's Strategic Petroleum Reserve in an effort to bring down prices she said "are helping push the economy toward recession." Bush repeatedly has rejected calls to use oil from the emergency government stockpile.

In other Nymex trade, heating oil futures fell 3.14 cents to $3.8516 a gallon while gasoline futures lost 1.77 cents to $3.3808 a gallon. Natural gas futures dropped 36.2 cents to $12.006 per 1,000 cubic feet.

August Brent crude rose 15 cents to $136.58 a barrel on the ICE Futures exchange in London.

Associated Press writer Ali Akbar Dareini contributed to this report from Tehran, Iran.