As the United States increases pressure on Russia in response to fears of a Ukrainian invasion, Russia’s leader, Vladimir V. Putin, has found solace in his most powerful partner on the global stage, China.

China has expressed support for Mr. Putin’s grievances against the US and NATO, joined Russia in attempting to block action on Ukraine at the UN Security Council, and dismissed American warnings that an invasion would create “global security and economic risks” that could consume China as well.

Mr. Putin will meet with China’s leader, Xi Jinping, in Beijing on Friday, ahead of the opening ceremony of the Winter Olympics, which President Biden and other leaders have vowed to boycott.

Although no details of any potential agreements have been disclosed, the meeting — Mr. Xi’s first in person meeting with a world leader in nearly two years — is expected to be yet another public display of geopolitical amity between the two powers.

A Chinese promise of economic and political support for Mr. Putin could jeopardize Mr. Biden’s strategy of isolating the Russian leader for his military buildup along Ukraine’s borders. It could also mark a tectonic shift in the rivalry between the United States and China, with ramifications stretching from Europe to the Pacific.

China’s leaders have been closely following the conflict between Russia and the United States over Ukraine, with reports in Chinese state media highlighting divisions among NATO allies and, at times, gleefully criticizing the United States.

The showdown has been viewed by the leadership as a test of American influence and resolve that could divert Mr. Biden’s attention away from his administration’s focus on China as the preeminent strategic rival of the twenty-first century. This includes increasing US support for Taiwan, the island democracy that China claims as part of its territory.

Administration officials in Washington are concerned that at the summit meeting in Beijing, Mr. Xi will reassure Mr. Putin of China’s support if the US imposes harsh economic sanctions on Russia, as the administration has threatened.

When the US imposed similar sanctions in 2014 in response to Russia’s annexation of Crimea, Mr. Putin turned to China as an alternative source of investment and trade, at least partially mitigating the impact. China signed a $400 billion gas deal with Russia that year, though Chinese officials did negotiate favorable prices for their companies because Mr. Putin was in a bind.

According to Maria Snegovaya, a visiting scholar at George Washington University who co-authored an Atlantic Council paper on American sanctions against Russia, the events of 2014 pushed Russia closer to China.

She predicted that China would once again help to mitigate the impact of sanctions, noting that the country is now a major buyer of Russian weapons, fish, and timber, and that it would be Russia’s largest importer of crude oil and natural gas in 2020.

China announced last month that trade with Russia had nearly tripled to nearly $147 billion, up from $68 billion in 2015, the year after it annexed Crimea and backed separatists in eastern Ukraine. Russia’s ambassador to China, Andrei Denisov, stated that the two countries are close to finalizing a deal for a second natural gas pipeline similar to the Power of Siberia, which began operations in 2019.

Aside from the economic benefits, the two countries have found a common cause in attempting to undermine American power and influence. In recent weeks, officials and state media in both countries have echoed each other’s attacks on the United States, reflecting an increasingly cynical view of American intentions.

China, like Russia, accused the US of fomenting the public protests that swept Kazakhstan. Sergei Naryshkin, director of Russia’s foreign intelligence service and a hawkish compatriot of Mr. Putin’s when both served in the Soviet K.G.B., said last month that the US planned to “aggressively and maliciously interfere” in the Beijing Olympics.

The Communist Party’s nationalistic newspaper, Global Times, seized on the comments to declare that the plot had been foiled. A headline read, “Failed attack campaign against Winter Olympics demonstrates US government incompetence.”