Russia's Gazprom and China National Petroleum Corp. (CNPC) have signed a historic 30-year contract to supply natural gas to China, according to Russia Today and confirmed by Bloomberg.

The total value of the contract is $400 billion, Gazprom CEO Aleksey Miller told RT, although the price in the document remains a "commercial secret." Negotiations have been ongoing for more than a decade.

The deal would send 38 billion cubic meters of natural gas to China each year, starting in 2018, with the potential to expand the annual capacity to 61 billion cubic meters.

The gas will be sent through a new eastern pipeline linking the countries. Reuters reports that Russia will invest $55 billion in gas exploration and pipeline construction and Beijing will give roughly $20 billion to Moscow as part of the agreement.

China consumed about 170 billion cubic meters of natural gas in 2013 and set a target of up to 420 billion cubic meters a year by 2020.

Europe is Russia’s largest energy importer as it bought more than 160 billion cubic meters of natural gas in 2013, but tensions and sanctions over Putin's meddling in Ukraine have Russia looking elsewhere.

Consequently, the deal is huge for the Kremlin since natural gas represents nearly 60% of Russia's total exports. That said, the amount of gas is still only about a fifth of what Russia sends to Europe.

The new pipeline that will be built to send Russian gas to China. Gazprom

Here's a look at the major gas pipelines between Russia and Europe: