But if Mattis was hoping that Prime Minister Narendra Modi would use the platform to join the US, Japan and Australia -- a grouping known as the Quad -- in a more muscular challenge to China's regional expansion, he was disappointed. Instead, India's strongest leader in decades navigated carefully between the two regional military powers.
Modi studiously avoided any mention of the Quad in his speech, and he hammered the kind of protectionism currently practiced by the US, both of which were sure to satisfy Chinese delegates.
"Asia and the world will have a better future when India and China work together in trust and confidence, sensitive to each other's interests," Modi told defense ministers and military officials assembled for the Shangri-La Dialogue, an event organized by the London-based International Institute for Strategic Studies.
Yet Modi has done something of a turnaround on China in recent weeks, a far cry from his ground-breaking shift to deepen engagement with the U.S. when he came to power in 2014, which was accompanied by a show at home of standing up to China's rise with a more robust "act east'' policy.
Tensions came to a head last summer when Indian and Chinese troops engaged in a standoff over a long-running border dispute. To embrace a more proactive India, the U.S. rebranded its Asia-Pacific policy as "Indo-Pacific," a change that fuels Chinese concerns about containment.
"The organizers of the Shangri-La Dialogue have been waiting for Mr. Modi for a while. India is seen as the linchpin for a longer term coalition to confront China," said Manoj Joshi, a distinguished fellow at the Observer Research Foundation in New Delhi. "Changing Asia-Pacific to Indo-Pacific was a means of getting Indian military capacity into the equation."
Still, tensions between China and India later subsided, and Modi has seemingly warmed to President Xi Jinping. On Friday, he reassured China that the Indo-Pacific was neither a strategy nor a club.
At the end of April, when the world's attention was focused on an historic summit between the leaders of South Korea and North Korea, Xi invited Modi for two days of informal talks in central China. Around the same time, reports emerged that India decided against inviting Australia to join annual naval exercises with India, Japan and the U.S. -- something Washington wanted and Beijing didn't.
This week, Modi will travel to China again, for a summit of the Shanghai Cooperation Organization, a security body dominated by China and Russia that India joined as a full member last year.
For some, the change is real, driven by a growing recognition that India simply lacks the economic and military capacity to compete with China, combined with growing uncertainty over the reliability of the U.S.
"Modi has simply understood that after a certain point India is not in a position to bear its fangs to China, especially given the unreliability of the U.S. under Trump,'' he said.
The raw spending numbers may even underestimate the disparity in hard power between the world's two most populous nations. Whereas China has plowed resources into developing and buying high-tech weapons, India spends as much as two-thirds of its defense budget on routine expenses such as personnel. In recent years, the percentage of the budget spent on capital investment has fallen.
When it comes to competing economically for the loyalties of countries in the region, the gap is even wider. India has no response to China's Belt and Road program, according to Syed Munir Khasru, director of the Institute for Policy, Advocacy and Governance, an international think tank headquartered in Bangladesh.
For others, though, the change is only one of optics, geared to the coming election. The security establishment remains alarmed by Chinese military expansion, in particular by signs it is looking for footholds in the Indian Ocean, which India has always seen as its preserve, said Rahul Roy-Chaudhury, who heads the South Asia program at IISS. Modi is simply seeking to ensure tensions don't flare up for the next year, he said.
At the same time, India doesn't want to let the U.S. draw it into a confrontation with China over the South China Sea, where China's territorial claims cross over with nations such as Vietnam and the Philippines. India has always been leery of freedom-of-navigation operations -- where ships sail through areas of contention to make a point -- and of developing the Quad into a security-focused organization.
"Modi,'' said Roy-Chaudhury, "is relentlessly pragmatic.''
Disclaimer: The opinions expressed within this article are the personal opinions of the author. The facts and opinions appearing in the article do not reflect the views of NDTV and NDTV does not assume any responsibility or liability for the same.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.