SHANGHAI (Reuters) - Preparations for an agreement on long-awaited Russian natural gas exports to China have entered "the final phase", China's state-run Xinhua news agency on Monday quoted Russian President Vladimir Putin as saying ahead of a two-day visit to Shanghai.

"For Russia, implementing these agreements means diversifying gas supply destinations, while for our Chinese partners ... it could be a remedy for energy shortages and helps ecological security," Xinhua quoted Putin as saying in an interview with Chinese media ahead of the May 20-21 visit.

A deal after nearly two decades of talks would secure the world's top energy user a key chunk of supply as demand for the cleaner burning fuel is set to surge.

For Russia, the deal to supply China with 38 billion cubic meters (bcm) of gas a year would help cut its dependence on Europe as the major market for its gas and create a strategic shift to Asia, as political pressure piles up over Ukraine.

Russian state-run Gazprom said at the weekend it was still "one digit" away from finalizing a 30-year gas supply deal with Beijing which is expected to crown Putin's visit to China next week.

Earlier this month, state China National Petroleum Corp (CNPC) said that it and Gazprom had reached an agreement to sign a contract during Putin's visit but that the two sides had yet to iron out price differences.

At 38 bcm per year, Russian supplies would be equal to nearly a quarter of current consumption and make up nearly a tenth of China's estimated total gas demand by 2020.

China is fast-tracking gas use, which is set to grow about 2.5 fold between 2014 and 2020, to curb use of the dominant but dirtier coal.

The country's state planning agency forecast last month that China would raise its total natural gas supply capacity to 400 billion cubic meters (bcm) per year by 2020.

(Reporting by John Ruwitch; Editing by Richard Pullin)