Brent crude edged higher on Tuesday as U.S. gasoline surged to four-month highs, fuelled by refinery problems in the midst of the summer driving season and rising prices for ethanol credits.

A spate of refinery outages across the U.S. over the past week has helped push U.S. RBOB gasoline futures up nearly 15 percent so far in July, even as government data showed demand rising faster than expected.

North Atlantic Refining confirmed it was in the midst of repairs at a sulphur recovery unit at its 115,000 barrel per day Come By Chance refinery in Newfoundland, Canada, which were expected to be completed early next week.

Traders said a spike in prices for ethanol credits, required by companies who make gasoline for U.S. consumption to comply with mandated renewable fuels requirements, further added to gains.

Prices for the credits have surged 30 cents this month and were trading above $1.30 a gallon on Tuesday due to concerns about a potential shortfall this year.

"Gasoline continues to move higher, it doesn't look like it has lost momentum, and I think we have probably further advances in front of us, though it does look vulnerable to a correction," said Gene McGillian, analyst, Tradition Energy in Stamford, Connecticut.

The front-month RBOB gasoline futures contract has traded over 70 on the relative strength index, a sign technicians say indicates a commodity may be overbought, since July 10.

RBOB gasoline futures rose more than 3 cents to settle at $3.1343 a gallon, the highest settlement since March 15.

Brent crude for August traded up 31 cents to settle at $109.40 a barrel, the highest settlement since April 2.

U.S. oil closed down 32 cents at $106.00 a barrel. U.S. crude's decline brought it back down to near 70 on the relative strength index. The front month contract has been trading at or above 70 since July 5.

Brent's premium to U.S. crude <CL-LCO1=R> traded as low as $2.32 a barrel, before swinging back out to $3.40 a barrel at the settlement.

Trading volumes were light, with U.S. crude 18 percent below its 30-day average near 3:30 p.m. EDT, while Brent volumes were about 15 percent below that average.

Traders were closely awaiting U.S. weekly inventory data from the American Petroleum Institute and the U.S. Energy Information Administration, respectively released late Tuesday and early Wednesday, for further signals.

A Reuters poll of analysts forecast a 2-million-barrel drop in crude inventories for the week to July 12, while gasoline stockpiles were seen down 500,000 barrels.