As China and Russia have grown closer in recent years through a deepening political partnership, the two countries' sometimes competing interests in Central Asia were viewed as a factor that could derail their warming ties.
While Moscow was seen as the main military provider in the region, Beijing's slow venture into Central Asian security in recent years with unofficial outposts and increased training -- combined with rising influence through its multibillion-dollar Belt and Road Initiative (BRI) infrastructure project -- created a cocktail for increased friction and potential rivalry.
But analysts say China's and Russia's handling of violent unrest in their mutual neighbor, Kazakhstan, has pushed the two countries even closer together. It has also highlighted the lengths the two powers are willing to accommodate each other during a fast-moving and high-stakes crisis.
"The crisis in Kazakhstan proved that the relationship between China and Russia in Central Asia is very stable," Jakub Jakobowski, senior fellow at the Center for Eastern Studies in Warsaw, told RFE/RL. "There are many difficult issues and potential problems for them to navigate and the fact that they have managed to do so demonstrates how durable ties between Beijing and Moscow are becoming."
Events in Kazakhstan began with protests over rising fuel prices on January 2 and quickly escalated into nationwide demonstrations calling for improved socioeconomic conditions and a more inclusive political system. Violence also spread to the streets and unrest evolved into several different crises.
Armed clashes against Kazakh security forces and looting led to President Qasym-Zhomart Toqaev requesting help from the Moscow-led Collective Security Treaty Organization (CSTO) military alliance and the arrival of a few thousand troops, predominantly from Russia.
Infighting among the country's elites also sparked a purge within Kazakhstan's corridors of power, with influential former President Nursultan Nazarbaev removed from a powerful position and his loyalist, Karim Masimov, ousted as head of the National Security Committee -- Kazakhstan's domestic intelligence agency -- while being accused of treason and attempting a coup d'etat.
The unprecedented crisis as well as its aftermath will have far-reaching consequences for Kazakhstan and are likely to further shake up Beijing's and Moscow's relationship, analysts say.
By intervening militarily and throwing its support behind the embattled Toqaev, the Kremlin signaled that it is still the leading security provider in a region that it views as its strategic backyard. At the same time, it also boosted its already sizable political influence.
The elite reshuffling under way in Kazakhstan could also undercut some of China's sway in the country, with Nazarbaev and Masimov -- two well-known interlocutors with Beijing -- being sidelined.
Despite such shifts and potential points of tension, Beijing and Moscow have used the crisis in Kazakhstan to increase their support for each other.
"They both share an overarching goal of keeping Central Asia stable," Jakobowski said. "China isn't trying to unseat Russia. Beijing thinks it has more important issues globally on its radar than to be the exclusive actor in Central Asia and there is a respect for Moscow's ambitions."
Finding Common Ground
China has invested tens of billions of dollars in Kazakhstan and Chinese President Xi Jinping even launched the precursor to the BRI during a visit to the country in 2013.
But as Kazakhstan erupted into chaos in early January, China remained muted about the unrest next door.
It wasn't until the CSTO deployment, which was officially dubbed a peacekeeping mission, was announced that Beijing shifted gears diplomatically and offered full-throated support for Toqaev, with Xi offering his support for efforts to put down what China deemed a "color revolution" in Kazakhstan.
After that, both the Chinese government and the increasingly nationalist state-run media pledged support for the Russian-led mission while calling for deeper coordination with Moscow in Central Asia and globally, as tensions between the Kremlin and Washington continue to grow.
During a January 10 phone call between Chinese Foreign Minister Wang Yi and Russian counterpart Sergei Lavrov, Wang said China welcomed the CSTO mission in Kazakhstan as having played "a positive role in restoring stability in Kazakhstan."
"The fact that the CSTO mission was requested by the Kazakh government and that it is labeled a peacekeeping mission makes it much less problematic for Beijing," Giulia Sciorati, a fellow at the Italian Institute for International Political Studies, told RFE/RL. "Peacekeeping is the one type of foreign intervention that official Chinese rhetoric tends to support."
Beijing has also echoed Toqaev's official narrative that the unrest was the result of a coup attempt with the aid of unspecified international terrorists, including Islamist militants, and used that to call for greater cooperation on counterterrorism in the region.
The China-led Shanghai Cooperation Organization (SCO), a regional security and economic bloc of which Kazakhstan and Russia are also members, said the violence in Kazakhstan was evidence that more needs to be done in the fight against the "three evils" of terrorism, separatism, and religious extremism, and at the same time offering to increase SCO involvement in the region.
Similar calls came from Zhang Xiao, China's ambassador to Kazakhstan, who told the state-run Global Times on January 12 that China planned to enhance law enforcement and security cooperation with Kazakhstan and its neighbors in order to oppose "external interference," whether it be Islamic extremism or "color revolutions" plotted by the West, a reference to the wave of popular protests that removed leaders from Georgia in 2003 and Ukraine in 2005 that Beijing and Moscow see as Western-backed and -funded.
"China loves to have this kind of continued rhetoric," Haiyun Ma, a professor at Frostburg State University who studies Beijing's relations with countries in Central and South Asia, told RFE/RL. "This narrative fits both Chinese and Russian needs as a warning about foreign threats and is a great opportunity to increase cooperation and marginalize the West."
A Wider Relationship
While China has adapted quickly to the events in Kazakhstan and moved to position itself closer to Russia in the region, Ma cautions that the unrest in Central Asia made Beijing "very nervous" and that the new state of affairs in Kazakhstan is still a "mixed bag for China."
The CSTO mission in Kazakhstan was the first time the organization had intervened on a member's territory and the alliance's added relevance could come at the expense of the SCO, China's preferred means for engaging with the region.
Moscow's decision to prop up Toqaev could lead to future Kremlin-friendly concessions from Nur-Sultan. Ma adds that the arrest of Masimov, a longtime China-hand within the Kazakh elite who spearheaded China's BRI plans in Kazakhstan, could also derail some of China's networks of influence in the country.
Still, Ma says this is unlikely to damage the wider Russia-China relationship and that when it comes to Kazakhstan, Beijing and Moscow are "not quite cooperating, but definitely not competing."
Ben Godwin, head of analysis at Prism Political Risk Management in London, says that China and Russia's positioning around the crisis in Kazakhstan also reflects shifting views within the Kremlin toward Beijing and about Russian foreign policy as a whole.
"Russia no longer views the engagement of other powers in its backyard as the zero-sum game that it did 10 or more years ago," Godwin told RFE/RL, referring to Russia's 2008 invasion of Georgia and 2014 occupation and annexation of Ukraine's Crimean Peninsula.
While the events in Kazakhstan will lead to a period of readjustment for Beijing and Moscow in Central Asia that could create some friction, they are unlikely to derail the broader dynamic between the two powers, who find themselves increasingly aligned against the United States.
"Russia doesn't want to occupy Kazakhstan. The purpose of the intervention was to demonstrate that Russia is the guarantor of authoritarian regimes around the world," Godwin said. "And China is perfectly happy for Russia to play that role."