TOKYO, Feb 7 (Reuters) - Japan's Prime Minister Shinzo Abeheads to Russia on Friday in a show of support for PresidentVladimir Putin at the Sochi Olympics, just hours afterheadlining a rally demanding that Moscow return islands seizedfrom Japan.

For Putin, the appearance of G7 leader Abe at Friday'sopening ceremony provides a high-profile seal of approval. TheRussian leader faces global criticism over the country's humanrights record and a recent law against gay "propaganda," whichopponents say curtails the rights of homosexuals.

U.S. President Barack Obama, French President FrancoisHollande, British Prime Minister David Cameron and GermanPresident Joachim Gauck are not attending the Games. The U.S.delegation includes three openly gay representatives.

Russia's domestic policies have not provoked controversy inJapan, but Abe's trip comes against the backdrop of theterritorial dispute. He leaves immediately after addressing anannual "Northern Territories Day" gathering, meant to pressureRussia into returning the islands, which Russia says comprisethe southern end of its Kurile chain.

Moscow took the islands east of Hokkaido days before Japansurrendered in World War Two, forcing 17,000 Japanese to leave.The often acrimonious dispute has kept the two countries fromsigning a peace treaty.

After last year's rally, two Russian fighter jets brieflyentered Japan's airspace near the islands, prompting Japan toscramble its combat fighters.

But Abe and Putin - said to be on a first-name basis - havenot let the dispute block progress in diplomacy centering onnatural gas and other resources.

By contrast, the leaders of China and Korea have rebuffedAbe's repeated calls to meet. Besides the isle spats, Abeangered Beijing and Seoul with a December pilgrimage to a shrinethey see as a symbol of Tokyo's past militarism.

Russia, too, criticised the shrine visit, but did not let itderail ties with Japan.

Abe's Sochi trip is "a manifestation that country-to-countryrelations are moving in a good direction," said former primeminister Yoshiro Mori, who has longstanding ties with Russia andhas done much of the legwork for Abe's bilateral diplomacy. Moritold reporters the two sides are trying to arrange for Putin tovisit Japan in the autumn.

Abe has made ties with Russia a priority, starting with afirst-in-a-decade Moscow summit. Talks are to continue thisyear, although neither side expects a swift end to the dispute.

"Through our personal relationship of trust, we will makeprogress on cooperation in such areas as security and economicsand engage in negotiations in earnest towards the conclusion ofa peace treaty," Abe told parliament recently.

Russia's Foreign Minister Sergei Lavrov welcomed the openingof the talks in Moscow last month but stressed that recognitionof the outcome of the war would be vital.

Moscow wants to bolster its position in East Asia as itwarily watches the growth of China's influence in the region.

"Putin, for his part, just like Obama, is shifting towardsEast Asia," said Nobuo Shimotomai, professor at Hosei Universityin Tokyo. "He aims to do that by playing Russia's soft-powertrump card, that is by selling energy to the region'scountries," he said.

Russia's energy sector is undergoing a dramatictransformation, with oil flows being redirected to Asia via theEast Siberia-Pacific Ocean pipeline. The country plans to atleast double oil and gas flows to Asia over the next 20 years,part of a pivot away from export routes to Europe.

This presents an opportunity for Japan, which has beenforced to import huge amounts of fossil fuel to replace itsentire nuclear power industry, shut down after the 2011earthquake and tsunami wrecked the Fukushima plant.

Japan now consumes a third of global liquefied natural gasshipments, a key reason for its record 18 months of tradedeficits.

Russian gas lies on Japan's doorstep and already makes upabout a tenth of its LNG imports. That could rise as Tokyo isdesperate to diversify and slash costs of energy imports.