Oil rose above $77 on Wednesday to reach the highest level since mid-May, tracking a recovery in global stock markets as risk appetite returns with easing concern about Europe's economy.

Japan's Nikkei average rose 1.8 percent on Wednesday to top 10,000 for the first time in a month after successful debt sales by some of the weakest euro-zone members boosted the euro and Wall Street a day earlier. .T

Traders shrugged off an industry report showing U.S. crude and products stockpiles climbed last week, turning their attention to the implications of the U.S. Gulf spill for future supplies after a speech by President Barack Obama on Tuesday.

Oil is basically moving with stock markets and the stock markets are moving with optimism and pessimism over the euro, said Keichi Sano, general manager of research at SCM Securities in Tokyo. Prices are getting into a higher range of $75-$85 for the coming two to three months.

ICE Brent crude oil for August, the front-month contract after July's expiry on Tuesday, gained as much as 39 cents to $77.49 a barrel, the highest since May 17, and was up 31 cents at $77.41 at 0647 GMT.

U.S. crude for July reached $77.19, the highest level since May 11, and was up 18 cents at $77.12, after posting a 2.4 percent increase on Tuesday.

Technical strength also provided a lift to oil, as U.S. front-month crude on Tuesday topped and settled above its 200-day average at $76.77.

(Reuters Insider: link.reuters.com/nus22m)

U.S. crude futures have for all of this year traded between the May 20 low of $64.24, the weakest front-month price since July 30, 2009, and the 2010 peak of $87.15 struck on May 3.

AWAY FROM FOSSIL FUELS

In a speech to the nation on Tuesday, Obama laid out what he called a battle plan to tackle the BP oil spill and exhorted Americans in warlike terms to embark on a mission to reduce their reliance on fossil fuels.

But the president came short of signaling changes in oil exploration and production, leaving market participants to wonder about the spill's long-term implications on deepwater drilling after the U.S. ordered a ban on such exploration for six months.

Maybe for the long-term oil price it's bullish, but for the nearby months I don't see any reason to be bullish or bearish, Sano said.

Obama offered no detailed prescription or timetable for passing comprehensive energy legislation.

The U.S. oil industry will certainly face tighter regulation and that is why we've seen oil prices respond at the back-end of the forward curve, said Toby Hassall, chief analyst at CWA Global Markets in Sydney.

The immediate implication of tighter regulations would be higher cost of production and potentially reduced supply relative to the status quo.

Traders were also awaiting confirmation of stockpile increases last week across all fuel categories and crude in the U.S. The Energy Information Administration will publish government statistics on Wednesday at 1430 GMT.

U.S. crude inventories rose 579,000 barrels last week even as crude imports fell, the American Petroleum Institute (API) trade group said on Tuesday, contrary to analyst expectations for a 1.2 million barrel drop in the latest Reuters poll.

Crude oil inventories at the Cushing, Oklahoma, pricing point rose 107,000 barrels, according to API data, putting pressure on the front month contract for U.S. crude.

Gasoline supplies rose 1.3 million barrels, above analyst expectations for a 200,000 barrel increase, while distillates including heating oil and diesel climbed 2.1 million barrels, double the analyst forecast for a 1 million-barrel rise.

U.S. weekly retail gasoline demand rose 1.4 percent in the week ending June 11 as prices at the pump continued to dip, the SpendingPulse report said on Tuesday. But year on year, demand dropped 2.2 percent, the report said.

(Editing by Ed Lane)