The gargantuan 30-year deal finally came to fruition after a decade of negotiations. It represents a turn to the east by Moscow at a moment when its geopolitical assertiveness, particularly the takeover of Crimea, has seen it heavily criticised by the West.
The signing in Shanghai was witnessed by Putin and Chinese President Xi Jinping, said Chinese energy giant CNPC, the country's largest oil and gas producer and a party to the contract.
"This is another major milestone achievement in China-Russia strategic energy cooperation," CNPC said in a statement.
Russia has been seeking more Asian markets, and its gas supplies to Europe via Ukraine are currently under threat because of unpaid bills by Kiev.
European Commission chief Jose Manuel Barroso told Putin in a letter Wednesday it was "imperative" that negotiations over payments by Ukraine continued, and that supplies were maintained during the talks.
For its part, China is constantly seeking resources to power the growth of its economy, the world's second largest. But China and Russia had for more than a decade been unable to agree on a price for the gas.
CNPC did not announce pricing information on the deal.
Russian media reports cited Alexei Miller, the chief of Russia's energy giant Gazprom, as saying the gas deal was worth $400 billion over its full term.
It was the firm's biggest-ever single agreement, he said, adding: "Such a contract has never been signed with any other company."
NJF/NJF