Oil edged higher on Wednesday, shaking off earlier losses following a large build up in U.S. gasoline inventories, buoyed by gains in the stock market and heavy spread trading.
Data from the U.S. Energy Information Administration showing a 3.65 million barrel rise in gasoline inventories last week, in the midst of the summer driving season, weighed down prices in early U.S. activity.
But markets got a boost after weak gross domestic product data prompted speculation the U.S. Federal Reserve would maintain its monetary stimulus, helping to push up stocks and crude. U.S. GDP expanded at a 1.8 percent annual rate in the quarter, adjusted from a previous estimate of 2.4 percent.
In addition, traders said heavy trading of the Brent-West Texas Intermediate spread, which settled at $5.94 on Tuesday and widened out to $6.23 on Wednesday, supported prices late in the day. The spread has dropped sharply from over $23 a barrel in February as new pipeline capacity eased a glut of crude in the U.S. Midwest.