(Adds comment, updates prices)
TOKYO, Sept 28 (Reuters) - Oil prices fell on Thursday, with U.S. crude giving up some of the previous session's gains that were driven by a surprise fall in inventories, while Brent moved further away from recent 26-month highs.
U.S. West Texas Intermediate crude (WTI) dipped 18 cents, or 0.4 percent, to $51.96 a barrel by 0206 GMT after rising 26 cents in the previous session to just below 5-month highs.
Brent was down 26 cents, or 0.5 percent, at $57.64 a barrel, slipping further away from Tuesday's more than two-year high of $59.49 following a near 1 percent fall in the previous session.
U.S. crude inventories fell 1.8 million barrels last week, the U.S. Energy Department said on Wednesday, versus forecasts for a 3.4 million-barrel build.
The crude draw provided some support to oil prices as refiners came back online following Hurricane Harvey last month, but gasoline stocks surprisingly rose and stocks of distillates were down by less than anticipated.
While the data gave a mixed picture, the outlook for demand has strengthened, said Ben le Brun, market analyst at OptionXpress in Sydney.
"Things are looking a little more optimistic, the most optimistic I have seen seen in the last couple of years," le Brun said. "Certainly a WTI price above $60 a barrel by the end of the year is not a crazy belief."
Still, U.S. crude production rose to 9.55 million barrels per day (bpd) last week, higher than before Harvey hit the Gulf Coast.
With Brent futures commanding their highest premium over WTI <WTCLc1-LCOc1> in more than two years, U.S. crude has become increasingly competitive in foreign markets and exports hit a record 1.5 million bpd last week.
That complicates efforts by the Organization of the Petroleum Exporting Countries and other major producers to push oil higher through output curbs, as every hike in price encourages more U.S. production. (Reporting by Aaron Sheldrick; Editing by Richard Pullin)