NEW YORK - When Chinese President Xi Jinping travelled across the border to Kazakhstan this week, he wrote in a local newspaper that mutual relations were "rock solid". Kazakh ties with its traditional Russian ally are not on such a firm footing.
Kazakhstan, which has a sizeable Russian-speaking population, notably declined to endorse President Vladimir Putin's invasion of Ukraine.
Alongside its political dissent, Kazakhstan has built alternative economic ties, with the European Union overtaking Russia as Almaty's largest trading partner.
It's just one example of the shifting allegiances in Russia's backyard of central Asia and the Caucasus, as nations that were once Soviet republics look to lessen their dependence on Moscow.
That process of economic and political diversification has been accelerated by Russia's war and the international sanctions imposed in response.
Administrations desperate to avoid getting hit by secondary sanctions are actively approaching the German government, the EU and the US for advice, especially in the financial sphere, according to Mr Eduard Kinsbruner, regional director for central Asia with the German Eastern Business Association, who led a trade delegation to Uzbekistan in July.
The region's governments have always had an interest in trading with Europe and Asia, "but now they're seizing their chances to attract more business", Mr Kinsbruner said in an interview in Berlin.
"There's huge potential."
It was in Kazakhstan that Mr Xi announced his flagship Belt and Road infrastructure and investment initiative back in 2013.
Mr Xi and Mr Putin met in neighbouring Uzbekistan on Thursday during the Shanghai Cooperation Organisation summit.
Yet for all the political symbolism, evidence of a reorientation shows up in trade statistics with Germany, Europe's biggest economy and a proxy for the EU as a whole.
As business with Russia collapsed, German trade with Kazakhstan was up 80 per cent in the first half of 2022 compared with last year, while Uzbekistan was up 111 per cent.
The volumes are still a long way from making up for lost Russia business, but enough for the German group to note the region's growing importance as part of an ongoing reconfiguration of global trade routes.
Kazakhstan - the region's largest economy and dominant country - mostly exports energy, but agricultural products and commodities for high-tech and e-mobility are of growing importance.
Uzbekistan, which is enacting a programme of economic reforms and a privatisation process, "is opening completely", said Mr Kinsbruner.
While in Tashkent, his German group ran into business delegations from France and South Korea.
The risk of instability may still weigh on the region's economic potential.
The Kazakh president asked Mr Putin to send troops in January to help crush violent protests in which at least 230 people died.
At least 18 people were killed in Uzbekistan in rare public protests in July against a proposed constitutional reform.
The long-running Caucasus conflict between Armenia and Azerbaijan remains unresolved.
Yet the region's oil and gas lend it strategic importance at a time when Europe's No. 1 challenge is replacing Russian energy supplies.
In July, the EU reached an agreement to double natural-gas imports from Azerbaijan via the Southern Gas Corridor, a network of pipelines connecting the Caspian Sea with Europe.
European Commission President Ursula von der Leyen travelled to Azerbaijan to sign the deal with President Ilham Aliyev, saying that the EU was turning away from Russia toward "more reliable, trustworthy suppliers - and I'm glad to count Azerbaijan among them".
Part of the motive for central Asian and Caucasus states to look beyond Moscow may be to avoid falling foul of Mr Putin and suffering Ukraine's fate.
Ukraine's Foreign Minister Dmytro Kuleba made that case on Sept 7, telling Uzbek journalists that "if we lose, then you'll be next", according to a report of his remarks in a local Uzbek newspaper.
Kazakh President Kassym-Jomart Tokayev has moved to build stronger ties with Turkey at the same time as he has distanced himself from Mr Putin's invasion.
In May, he made his first state visit to Turkey since becoming President in 2019 and signed an "enhanced strategic partnership" agreement with President Recep Tayyip Erdogan.
The two sides signed accords to produce Turkish military reconnaissance and strike drones in Kazakhstan, and to boost cooperation between their intelligence services, as well as simplifying customs controls.
Mr Tokayev has also invigorated relations with Saudi Arabia and Qatar.
In a July call with EU Council President Charles Michel, he said that Kazakhstan could help at a time of deepening geopolitical fractures by acting as a "buffer market" between east and west, south and north.
Mr Putin's war on Ukraine has caused Kazakhstan to "seriously rethink its strategic and economic security, and to diversify away from Russia where possible", said Ms Kate Mallinson, founder of Prism Political Risk Management in London.
For many in the region, it's a case of rebalancing Moscow's influence to add other sources of economic growth at a time of shifting global trade routes, not least as a result of Russia's war.
The flare-up in the conflict between Azerbaijan and Armenia further complicates the picture, thwarting efforts to open long-closed borders and the development of transport links.
Ultimately, these would strengthen Turkey's access to central Asia via land routes and the Caspian Sea, allowing states in the region to build ties with Ankara and the EU, bypassing Russia.
For now, Russia and China remain key players.
Uzbekistan signed a flurry of deals with Chinese entities in late August, including wind power projects and bank loans to supply technology equipment and raw materials from China, according to Janes IntelTrak Belt and Road Monitor.
Armenia's trade with the EU jumped by nearly 38 per cent in the first half of 2022, according to the National Statistical Committee, but this was overshadowed by a 50 per cent increase in trade with Russia.
While the EU is Kazakhstan's largest trading partner, Russia still accounted for 38.5 per cent of Kazakh exports in the first half.
"Kazakhstan can't just ditch Russia: it's too reliant on it for business, trade routes and - ironically - security," said Mr Chris Tooke, London-based director of political risk at J.S. Held, a global consulting firm.
"And Moscow's made it abundantly clear that it can stir up trouble for Kazakhstan on multiple fronts." BLOOMBERG