Days after returning from a trip to Europe where he was lectured about the need to rein in Russia, China’s leader, Xi Jinping, used a summit with President Vladimir V. Putin to convey an uncomfortable reality to the West: His support for Mr. Putin remains steadfast.

Mr. Xi’s talks with Mr. Putin this week were a show of solidarity between two autocrats battling Western pressure. The two leaders put out a lengthy statement that denounced what they saw as American interference and bullying and laid out their alignment on China’s claim to self-ruled Taiwan and Russia’s “legitimate security interests” in Ukraine.

They pledged to expand economic and military ties, highlighted by Mr. Putin’s visit to a cutting-edge Chinese institute for defense research. Mr. Xi even initiated a cheek-to-cheek hug as he bade Mr. Putin farewell on Thursday after an evening stroll in the Chinese Communist Party leadership compound in Beijing.

Western leaders looking for signs of any meaningful divergence between Mr. Xi and Mr. Putin, particularly on the war in Ukraine, would find none. Neither the risk of alienating Europe, a key trading partner needed to help revive China’s struggling economy, nor the threat of U.S. sanctions targeting Chinese banks that aid Russia’s war effort appeared to deter Mr. Xi’s embrace of Mr. Putin.

“The overarching goal of both Putin and Xi is to fight back against what they perceive as their existential enemy, which is the United States and the U.S.-led international order,” said Alicja Bachulska, an expert on Chinese foreign policy at the European Council on Foreign Relations. For China, “Yes, there are tensions with the West, but these tensions won’t lead to any kind of qualitative change in the way China has been approaching Russia and the war in Ukraine.”