NEW YORK (CNNMoney.com) -- Oil prices set a record high Wednesday, nearing $79 a barrel, as refineries ramped up output and took a big chunk out of crude supplies.
Oil prices then sold off sharply as traders took profits and focused on the large additions to gasoline and heating fuel supplies - the result of all that refining activity.
U.S. light crude for September delivery fell $1.68 to settle at $76.53 a barrel on the New York Mercantile Exchange. Oil set a new record trading high of $78.77 just after the report's release, surpassing its old trading high of $78.40 a barrel.
In its weekly inventory report, released a few minutes early apparently due to a mistake, the Energy Information Administration said crude stocks fell by 6.5 million barrels last week. Analysts were looking for a drop of 700,000 barrels, according to a Reuters poll.
Fueling the drop was a return of refineries, which the report said operated at 93.6 percent capacity last week, far higher than expected.
Although crude supplies are still well above average levels, one oil broker said the concern is that ramped up refining activity will lead to declining global stockpiles throughout the second half of the year.
"The market still looks ahead, and it sees weeks of drawing inventories," said Andrew Lebow, a broker at MF Global in New York.
But staying above $78.40 could be a challenge for crude. Over the last several months, traders have had a tendency to "fade" Wednesday's inventory report, meaning they use an early rise in prices as a chance to sell and take profits, or they use an initial decline as a chance to buy.
If oil can close above $78.40 for a few days in a row, some say the stage could be set for a run at $100 a barrel.
But keeping oil above $78.40 is far from certain.
"I think we've seen the high trading mark for a while," Ira Eckstein, president of Area International Trading Corp., said from the floor of the NYMEX.
Eckstein said with prices higher now for oil delivered immediately compared to oil delivered a month of several months in the future, there is incentive to sell crude now.
Also pushing prices lower Wednesday -and good news for motorists - is that the increase in refining activity boosted supplies of refined products, the report said, noting that refineries made more gasoline last week than ever before.
Distillates, used to make heating oil and diesel fuel, rose by 2.8 million barrels while gasoline supplies gained by 600,000 barrels. Analysts were looking for a 1.4 million barrel build in distillates supplies and a 500,000 barrel increase in gasoline stockpiles.
This marks the seventh straight week gasoline supplies have gained, which has helped push retail prices down 11 percent since they set a record high of $3.227 a gallon in May. As of Wednesday, the national average for a gallon of regular stood at $2.87, according to the motorist organization AAA.
"Ultimately, [refined] products may be a factor in taming this crude rally," said Lebow. Still, he didn't go so far as to predict a substantial drop in crude anytime soon. "This crude has been a monster. Whenever you start getting bearish, you feel sorry a day later."
Oil has rebounded from the low $60s just a couple of months ago, with U.S. crude having been dragged down due to heavy refinery maintenance and series of unplanned outages that caused a glut of supplies.
But as refiners returned to normal activity, crude supplies have dropped, and that has helped bid up the price. Renewed trouble in Nigeria, the nationalization of oil facilities in Venezuela, and reports projecting stronger demand and decreased supply over the next few years have also fueled oil's recent rally.
The tight supply and demand picture is the main reason cited for oil's price surge since 2002, when it traded at just $20 a barrel.
High demand in the United States, as well as developing nations like China, India and Brazil, has not been met with a similar increase in oil supplies.
That means the difference in what the world could currently produce and what it currently consumes has narrowed, which magnifies the effect of any supply disruption - such as a hurricane in the Gulf of Mexico or even a possible war with Iran - as there is less spare capacity in other parts of the world to pick up the slack.
It has also attracted lots of money from investors betting on crude prices, which one recent study said is adding $10 a barrel to the price.