Russian president Vladimir Putin meets with Chinese president Xi Jinping in Shanghai, where the two leaders finalized a natural gas deal. Reuters

Following 10 years of negotiations -- and a well-publicized delay Tuesday, reportedly on prices -- China and Russia early Wednesday agreed to a 30-year, $400 billion deal to ship Russian natural gas to China. Russian President Vladimir Putin announced that both sides were “in the end pleased with the compromise reached on both price and terms.” What pleases both sides is certainly economic, but it is most certainly geopolitical, too.

The deal makes considerable economic sense for both countries. Though Russia does not represent China’s only access to natural gas, the ex-Soviet states to China’s west account for 80 percent of Chinese imports, the deal provides Beijing with an additional source of relatively clean energy, vital in a country struggling with the environmental effects of mass coal burning. In addition, natural gas is cheaper to import than liquefied natural gas, and despite significant investment Chinese efforts to extract shale gas have yet to yield much success.

Meanwhile, the deal allows Russia to diversify its energy exports away from Europe, which now threatens Moscow with sanctions over Russia’s annexation of Crimea, and gain access to China’s huge, growing market. For the sputtering Russian economy, forecast to grow by just 0.2 percent in 2014, the news was encouraging: Shares of OAO Gazprom, the country’s gas giant, rose by 2 percent Wednesday.

Aside from Gazprom's stock price, the short-term economic impact of the deal may be modest. Liquid gas sales won’t begin until 2018, when Russia will begin shipping 38 billion cubic meters each year to China, a number that may reach 61 billion during the deal’s duration. While substantial, the amount is still just a fraction of the 158 billion cubic meters that Russia currently exports to Europe, which is likely to remain Moscow's largest recipient for gas exports for years to come.

But the long-term geopolitical ramifications are significant. Both China and Russia’s relations with the United States are strained, and seem unlikely to improve in the near future. In the United Nations Security Council, where Beijing and Moscow serve as permanent members, the two sides have stymied American-led efforts to provide lethal aid to Syria’s opposition. Washington, for its part, condemned Russian annexation of Crimea, and has denied senior Russian officials permission to travel abroad. And in East Asia, where President Obama conducted a multi-country visit in May, the United States has sided with Japan in its dispute with China over an uninhabited archipelago in the East China Sea.

Whatever its economic consequences, the natural gas deal serves as evidence that Russia and China are seeking close diplomatic ties -- a trend that will have applications far beyond natural gas sales.