MOSCOW — On the eve of a celebration commemorating to the defeat of Nazi Germany, the presidents of Russia and China on Friday signed 32 bilateral agreements designed to highlight the warming of relations between the countries even as Russia’s have soured with the West.

President Vladimir V. Putin of Russia and President Xi Jinping of China presided over a signing ceremony that included a road map to balancing their regional interests in Central Asia, secured more than $6 billion in Chinese investment in a Russian intercity rail line and established an information security agreement heralded as a “nonaggression pact” between the countries in cyberspace.

Yet amid the warm words and declarations of shared intent from the two leaders, there were also signs of tense, behind-the-scenes negotiations. Notably absent from the agreements signed Friday was a compromise on a price for gas to be sold by Russia to China through a new, multibillion-dollar pipeline from the fields of Western Siberia to the Chinese border.

Particularly since the imposition of Western sanctions over Russia’s military actions in Ukraine, Russian patriotic politicians and state television have promoted China as a country that, unlike Europe, can provide access to investment and markets but also shares Russia’s values and recognizes its regional interests.