In 1972, at the height of the Cold War, President Nixon made his famous visit to China to normalise relations with Beijing and thus gain advantage against its superpower rival, the Soviet Union. This week, Russia’s Vladimir Putin made his journey to China. The countries in this strategic triangle are the same, but their roles have been transformed.

Russia, the successor state of the Soviet Union, is a diminished power. The US remains a superpower, but also in decline, at least in relative terms. That trend in turn reflects the emergence of China – dormant 40 years ago – as a mighty global force, with an economy expected soon to overtake that of the US.

In 1972, the odd man out in the triangle was Moscow. In 2014, Presidents Putin and Xi Jinping are trying to forge an alliance that will cut the US down to size.

Download the new Independent Premium app Sharing the full story, not just the headlines

One symbol of this intent is the current joint naval exercises, whose launch was attended by both leaders. Far more important is the massive 30-year deal signed yesterday for the sale of Russian gas to China, starting in 2018, and which includes substantial Chinese investment in Russia’s infrastructure. The agreement will provide a new outlet for the energy exports on which the Russian economy largely depends. More broadly, it may be seen as part of a “pivot to Asia” by Moscow, focused on deepening ties with the East, rather than the West.

Rarely has the logic driving this new alignment been as obvious. US relations with both China and Russia have sharply deteriorated. In the case of Moscow, the Ukraine crisis has raised tensions with the West to levels not seen since the Reagan era, and generated talk – by no means fanciful – of a second Cold War. Mr Putin’s unconcealed ambition to restore a de facto Russian empire have only fuelled such fears.

China and the US, economic and increasingly geopolitical rivals, are now at loggerheads over Beijing’s perceived expansionism in South-east Asia, which has brought it into conflict with several close American allies in the region. Then came this week’s unprecedented criminal indictments in the US against Chinese military officials for cyberspying. Not surprisingly, Beijing speaks of a major setback in relations with Washington, while proclaiming that those with Moscow have never been better.

In some respects, this Sino-Russian rapprochement may make little difference. Economically, Russia needs China far more than the other way round: not just as an energy market but as a source of capital, when its economy is slowing and tensions over Ukraine threaten financing and investment by the West. Beijing, moreover, has been finding other sources to slake its energy thirst. That has allowed it to drive a hard bargain over the price of Russian gas, causing a delay in the signature of the deal in Shanghai until yesterday’s early hours.

But in the end, political considerations prevailed, and these could make a very big difference. Already, China is increasingly supportive of Russia position on Ukraine. Now, the prospects of resolving crises in Syria and elsewhere through the United Nations Security Council, where both countries have veto power, are even more remote. Between them, they could make it even harder to secure a satisfactory nuclear deal with Iran. In each case, the loser will be the other party in geopolitics’ eternal triangle: the US.