At the start, Russia's armed intervention in Crimea posed a ticklish problem for China: A country that it wanted to befriend had violated the cardinal principle of Beijing's foreign policy – nonintervention in other states' domestic affairs.
Now that Moscow's annexation of the Black Sea peninsula is a fait accompli, however, Chinese strategic thinkers are beginning to see a possible upside. If Russia's relationship with the West goes into the deep freeze, they expect President Vladimir Putin to be looking for comrades elsewhere. And Beijing's arms are open.
Were Washington to continue its efforts to isolate Moscow, "that would push Russia closer to China," predicts Yan Xuetong, one of the most prominent Chinese foreign-affairs analysts. "It would be a gift."
Not that such a geostrategic shift would be all convivial. The two authoritarian giants have been wary neighbors, and while they share an interest in undermining US global dominance, they are themselves competitors for influence in Central Asia.
Nor would closer ties with Moscow sit comfortably with Beijing's principles; endorsing Crimea's right to self-determination would make it hard to refuse Taiwan the same privilege.
But Beijing has been careful not to offer such endorsement, pointedly abstaining on the United Nations Security Council vote that would have declared the Crimean referendum illegal. Russia vetoed that resolution.
China "did not support Russia all the way," explains Jia Qingguo, associate dean at Peking University's School of International Studies. But "now that China has made its point ... it probably would not take further action on this issue," such as joining Western sanctions against Moscow.
Instead, Beijing is more likely to take advantage of the situation. For a start, suggests Professor Jia, Moscow might be more inclined to make concessions in negotiations to supply gas to China; talks have been snarled for five years over a price dispute.
On the broader diplomatic front, Beijing could look forward to other unexpected benefits. For years, China has sought, unsuccessfully, to build firmer friendships with powerful neighbors, such as Russia and India, in order to bolster its position on the world stage.
"If Russia were an ally," says Mr. Yan, "it would be willing to give us more support on international issues, both in East Asia," where China is embroiled in territorial disputes with Japan and other nations, "and internationally. To become a global power in 10 years, that is what China needs."
Such ties would also be a godsend to Chinese geostrategists, who have always kept a weather eye on their giant neighbor to the north. "Good relations with Russia would make China feel more secure," Jia points out.
Beijing would have to move cautiously in that direction. For decades, Chinese diplomats have made good relations with Washington a keystone of their foreign policy and they would be loath to get on the wrong side of the United States.
But as China begins to flex its international muscles more boldly, "who is to say we are on the wrong side?" asks Yan. "We would just be on the other side."