NEW DELHI - Narendra Modi has trumpeted a new era of friendship with Barack Obama but experts say the Indian premier will be careful not to alienate traditional ally Russia or giant rival China.
The US president was the chief guest at India's Republic Day parade on Monday after accepting an invitation that is one of the biggest honours a country can bestow on a foreign leader.
Obama and Modi sat side by side watching the display of military might - including gun-toting soldiers on camel-back and Soviet-era tanks - that characterises the annual celebrations of the birth of modern India.
Their strong show of solidarity, which followed lengthy talks on Sunday and a breakthrough in a long-stalled nuclear pact, is seen as a crucial counterweight to an increasingly assertive China.
But experts say Modi will also be keen to strike a diplomatic balance between the US and China, whose companies the premier desperately needs to invest in India's dilapidated infrastructure.
"Modi is proving to be the ultimate realist on the balancing question," said Ashley J. Tellis, a South Asia expert at the Carnegie Endowment for International Peace.
"He has a very subtle but very clear view about how he thinks of the United States and China. He wants to use the relationship with China for everything it's worth, particularly on the economic side."
"So whether they admit it or not there is a triangular game in play from Delhi's point of view, and he wants to play the game in a way that advantages India."
In a sign of the balancing act Modi faces, China's state-run media dismissed the new friendship between the world's two largest democracies, pointing to their "hard differences" on issues such as climate change.
"The... (Obama) visit is more symbolic than pragmatic, given the long-standing division between the two giants, which may be as huge as the distance between them," Xinhua news agency said in a commentary.
Modi rolled out the red carpet for Chinese President Xi Jinping when he visited in November, the two leaders sharing a dinner on the Indian premier's 64th birthday in his home state of Gujarat.
But relations between the nuclear-armed neighbours are still characterised by mutual suspicion, in large part as a legacy of a brief but bloody war in 1962.
During Monday's military parade, much of the hardware on display was Russian-made, underscoring India's traditionally strong ties with Moscow.
Those strong relations date back to the 1950s after the death of Stalin. And today, Russia, India and China are part of the so-called BRICS grouping of major developing economies seeking to promote a multipolar world economy not dominated by the United States.
"Russia has been a good and old friend since just after independence and we want to nurture that," said Neelam Deo, a former Indian diplomat and director of Mumbai-based think-tank Gateway House.
"Historically our defence ties with Russia have been strong and also energy ties, but still bilateral trade is only $10 billion compared to $100 billion with the United States," she told AFP.
The US has surpassed Russia as India's biggest arms supplier. On Sunday Obama and Modi signed a new 10-year bilateral defence pact and agreed to cooperate on building an aircraft carrier and other projects.
But with India underdoing a major modernisation of its military, Russia is not expected to relinguish control of the lucrative market without a fight.
Russian Defence Minister Sergei Shoigu was in New Delhi only last week, reportedly to iron out disagreements over the supply of a fifth-generation fighter aircraft.
And for all the excitement over Obama's attendance at Monday's parade, Russian President Vladimir Putin was the chief guest back in 2007.
Modi on Sunday said Obama's three-day visit "reflects the transformation of our relationship", adding that the two countries were natural allies.
The visit caps a remarkable turnaround given that Modi was shunned for years by Washington over religious riots that erupted in 2002 in Gujarat.
Analyst Satish Misra said the newfound friendship could translate into stronger trade and other economic ties, but it did not mean Modi was beholden to Washington.
"Modi is not the kind of leader who is going to succumb to pressure from the United States on geopolitical or other issues," Misra, of the Delhi-based Observer Research Foundation think-tank, told AFP.
"There are no (diplomatic) camps any more. India will do what is best for India. It's the political reality for everyone."