Mongolia was a Soviet satellite for decades but now fears economic domination by China, with this week's visit by Russia's Vladimir Putin, hard on the heels of Xi Jinping, highlighting its delicate balancing act, analysts say.
Although dwarfed by its massive neighbours, landlocked Mongolia is still one of the world's 20 largest -- though least densely populated -- countries, its three million people spread across more than 2,000 kilometres (1,200 miles) of mountains, rolling steppe and rocky desert.
In the face of strategic and geographic reality, it has sought to reach out to other powers, including the United States and Japan, in what is known as a "third neighbour" strategy.
Mongolia enjoyed world-beating growth in recent years -- peaking at 17.5 percent in 2011 -- on the back of a resources boom, primarily coal, copper and iron ore.
But resource nationalism has since become the defining issue in Mongolian politics, with rules on foreign investment tightened after corporate deals threatened to see one of the country's biggest coalmines fall into Chinese hands.
Foreign direct investment has since plunged, down 70 percent in the first half of this year, while growth slowed to 5.3 percent in the same period, and it also faces rising inflation and a falling currency.
Ulan Bator is looking to counter the decline by exploiting more of its estimated $1.3-trillion of mineral resources, and both presidential visitors oversaw the signings of multiple agreements in business and other areas.
But at the same time it is painfully aware of the risks of being dominated by any one partner.
"Mongolian foreign policy is based on precisely that balance between Russia and China," said Julian Dierkes, a Mongolia expert at the University of British Columbia.
- 'Differences in our cultures' -
To the south, China is responsible for more than half of all Mongolia's foreign business, but with the world's most populous country and second-largest economy on their doorstep, many Mongolians are highly suspicious of increased Chinese investment, and anti-Chinese sentiment is longstanding.
"This traces back in history ever since China has become an urban settled civilisation, (whereas) Mongolia has its nomadic civilisation," explained Munkhdul Badral, an entrepreneur and founder of news service Cover Mongolia.
"These are differences in our cultures, and where the very beginning of tensions began."
They "never stopped", he said, even at the height of Mongol power, when Genghis Khan's descendants ruled the largest contiguous land empire in history, stretching from eastern Europe to the South China Sea.
"There's always been fighting and wars," said Badral. "At one point we conquered China -- and at one point, China conquered Mongolia.
"But nowadays, it comes down to economic reasons why Mongolians are so suspicious of China."
Mongolia was in Moscow's orbit and under Communist rule from 1924 to 1990, when the Soviet Union to the north was its major trading partner.
It remains heavily reliant on Russian fuel and electricity supplies, and political ties with Moscow remain strong, as do post-Soviet nostalgia and pro-Russian sentiment in some quarters.
Many Mongolians speak Russian and many of its artistic stars were educated in Russian schools.
"Mongolia sees itself as culturally aligned with the West, and eager to distinguish itself from Asian countries," said Franck Bille, a social anthropologist at Cambridge University.
Putin's visit was his third since he first became Russian president in 2000, and in 2003 Moscow eradicated some 98 percent of Mongolia's Soviet era debt.
It then sought out mining and infrastructure projects, but its efforts have been "plagued by problems", said Sergey Radchenko, an international politics specialist at Aberystwyth University.
Notably it failed to secure a contract to develop Tavan Tolgoi, Mongolia's largest coal deposit.
"It just does not have the leverage -- and what little it has is set to diminish in coming years as China's economic pull continues to bear weight on Mongolia," Radchenko told AFP.
China's foreign ministry spokesman Qin Gang played down any differences, describing the three countries as "neighbours linked by mountains and rivers".
"We are ready to make joint efforts with Mongolia and Russia to realise the common stability and development of the region," he said.
- 'Third neighbour' -
Squeezed between the Chinese dragon and the Russian bear, Mongolia has sought to develop a "third neighbour" strategy, seeking strong ties with countries beyond its immediate borders.
It has formed strong links with the United States, which views it as a strategic counterweight to its powerful neighbours and spends about $2 million a year on military equipment for its 10,000-strong army.
The then Secretary of State Hillary Clinton praised the Mongolian people's "commitment to democracy" when she visited in 2012, and Defense Secretary Chuck Hagel came to Ulan Bator this April.
Japanese Prime Minister Shinzo Abe visited last year, while Mongolia's President Tsakhia Elbegdorj signed a free trade deal in Tokyo in July.
"Mongolians are always balancing -- with Russia, with our 'third neighbours'," said Badral. "It's not to say that we don't want to trade with China, it's just that we need to protect our economic interests."
China is the only country with which Mongolia has a trade surplus, he pointed out. "We realised that it's inevitable that we'll have to deal with China. Anti-Chinese sentiment will always be there, but hopefully it will become more reasonable in future.
"All of China's neighbours, we should all have the same level of wariness when it comes to balancing Chinese economic influence over our countries."