Oil rose on Friday, with U.S. oil ending within sight of $106, as a string of refinery outages stoked concerns about fuel supplies in the heart of the U.S. summer driving season.
"We're hearing about a lot of refining issues and this comes as oil prices came off that 15-month high," said Phil Flynn, analyst at the Price Futures Group in Chicago.
"Put it all together and I think you're seeing some panic buying by the wholesalers afraid they're going to run out of supply."
The refinery issues came from plants from the U.S. Gulf Coast, East Coast, Midwest, and Canada, after U.S. government data this week showed gasoline demand over the past four weeks surged 2.5 percent from a year earlier, surprising some traders.
RBOB gasoline futures jumped more than 12 cents, extending gains since the start of July to nearly 15 percent. With strong demand in recent weeks, buying picked up on news of refinery problems, many around gasoline-making units.
Front-month gasoline futures hit highs of $3.1455 per gallon at the peak, and traded up 10.62 cents to $3.1276 per gallon by 12:58 p.m. EDT.
Brent crude for August rose by more than $1, trading shy of $109 a barrel, after touching a low of $107.28. The contract was little for the week after pulling back from $108.93 on Thursday, the highest since April 3.
U.S. crude rose by $1.05, ending the session at $105.95, above the prior day's close yet below a 16-month high at $107.45 it hit earlier this week.
U.S. stock indexes hit record highs on Thursday, and riskier assets including oil were supported after Federal Reserve Chairman Ben Bernanke said the U.S. central bank will keep a loose monetary policy for some time to lower unemployment.
Tight supply was also behind stronger prices. U.S. data on Wednesday showed the biggest two-week drop on record in crude stockpiles, while refinery production hit a five-year high.
New York Harbor gasoline futures were up 1.5 percent and on Thursday topped $3 per gallon for the first time since March with the onset of the summer driving season.
"The positive earnings tied in with lower inventories is feeding into better sentiment and pushing oil higher," said Michael Hewson, analyst at CMC Markets.
Lingering worries that violence in Egypt could disrupt supply through the Suez canal also helped underpin prices.
These factors outweighed concern about China's demand outlook, and the prospect of growing non-OPEC supply offset lower inventories in the United States.
China's finance minister signaled that Beijing may be willing to tolerate economic growth in the second half of the year significantly below 7 percent this year, marking the most sobering comment to date from a senior policymaker on the country's slowdown.
That came after warnings from China earlier this week of a "grim" outlook for trade after a surprise fall in June exports, raising concerns that the world's second biggest oil consumer would no longer be the buoyant force for oil it has been for the last decade.
Brent remains close to a three-month peak reached the session before on political uncertainty in Egypt, falling U.S. crude inventories and a weaker U.S. dollar
Capping gains, non-OPEC supply is set to grow at the fastest pace in decades next year, the International Energy Agency (IEA) said on Thursday.