Kazakhstan, which shares the world's longest continuous border with Russia, has long balanced its status as Moscow's most trusted ally in ex-Soviet Central Asia with attempts to maintain cordial ties with the West.
But Moscow's invasion of Ukraine, combined with Russian perceptions that the Kremlin secured the Kazakh regime during a political crisis earlier this year, has turned that balancing act into a high-wire walk, experts say.
The most recent sign of tensions came at an economic forum in Russia's second city St. Petersburg last week, as Kazakhstan's President Kassym-Jomart Tokayev discussed world politics with his Russian counterpart Vladimir Putin.
Tokayev reiterated his country's refusal to recognize what he called "quasi-state" entities in eastern Ukraine, where Moscow has been advancing since invading in February.
The Kazakh president also criticized Russian politicians and commentators, whom he accused — without naming names — of sowing "discord" between the two countries by launching public attacks on Kazakhstan.
Arkady Dubnov, a long-time watcher of Russia's relations with Central Asian states, said Tokayev's comments were "impressive" given he was standing in front of Putin.
"Tokayev is the type of figure we are no longer used to seeing (in Russia). He did not fawn, he looked directly into Putin's eyes," Dubnov said in a Wednesday interview with the Russian media outlet Republic.
'What is this ingratitude?'
One of the most strident critics of Kazakhstan's neutral stance on Ukraine has been Margarita Simonyan, the editor-in-chief of Russia Today, who moderated Putin and Tokayev's discussion on June 17.
In February Kazakhstan's foreign ministry ruled out recognizing the territories Moscow calls the Luhansk and Donetsk "People's Republics." Not long after, Simonyan asked her social media followers why Russia had "saved" Kazakhstan during a historic bout of unrest at the start of the year.
Simonyan's husband, television show presenter Tigran Keosayan, went further in April, unleashing a tirade against Kazakhstan's leadership that was so vicious the foreign ministry pledged to bar him from the country.
"Look carefully at what is happening in Ukraine," Keosayan threatened, calling the government "sly asses."
"What is this ingratitude?"
Tokayev appeared to be on shaky ground in January, as protests over an energy price spike swept the nation and more than 200 people died in subsequent clashes with the military.
The arrival of troops from a Moscow-led security bloc, the Collective Security Treaty Organization, bolstered Tokayev's position at the expense of a powerful political clan tied to his long-ruling predecessor, who was seen by some as using the crisis to usurp the president.
'A more supportive position?'
In an interview with Russian media earlier this month, Tokayev pushed back against the idea that Kazakhstan had been saved by the intervention.
But Maximilian Hess, a fellow with the U.S.-based Foreign Policy Research Institute, told AFP that the Kremlin is unlikely to see it that way.
He said that Kazakhstan may already be suffering retaliation.
Since the invasion began, a Russia-controlled pipeline carrying both Russian and Kazakh oil — whose deliveries account for more than half of Kazakh crude exports — has twice had stoppages.
Hess argued the stoppages smelled of politics, even if both sides offered other explanations.
"There are significant links between the Russian and Kazakh business elites that Putin can lean on to try and pressure Kazakhstan to take a more supportive position," Hess added.
But while Russian pressure is to be expected, Kazakhstan "cannot jeopardize its core national interests," Nargis Kassenova, a senior fellow at Harvard University's Davis Center for Russian and Eurasian Studies, told AFP.
That includes territorial integrity, "hence the non-recognition of quasi-states," Kassenova said, as well as avoiding the deep economic isolation that Russia has fallen into due to unprecedented Western sanctions.
Dosym Satpayev, a political analyst based in Kazakhstan's largest city Almaty, said Tokayev's comments on Ukraine at the forum were inevitably addressed to a domestic, as well as foreign, audience.
Among Kazakhstan's diverse population of 19 million, which includes large Russian-speaking and ethnic Russian parts, Moscow's hyper-aggressive foreign policy has attracted both support and opposition, he said.
Tokayev is also trying to bridge a "legitimacy gap" after questions about his own role in the violence in January, Satpayev told AFP.
For his part, the Kazakh leader appeared intent on smoothing the hubbub over his comments to Putin during an appearance at another economic forum in Qatar.
Speaking in English to Bloomberg TV on Tuesday, career diplomat Tokayev said Putin was a "staunch ally" with whom he had a "very nice meeting" immediately after the St. Petersburg event.