But away from the choreography of high diplomacy, more than 200 Chinese soldiers entered disputed territory at the Chumur sector in Ladakh and set about building a two-kilometre road, forcing the Indian military to rush in reinforcements. Around the same time, the Chinese objected to an irrigation canal being built at Demchock about 80 km away and sent hundreds of civilians to protest the work being done by Indian civilians.
As a consequence, the Chinese president's visit was overshadowed by what was happening at the border. And this has been the persistent narrative about Sino-Indian relations. Despite an attempt by India to focus on the positives in the relationship, China continues to keep the border boiling. Mr Modi was forced to respond that the two nations need to resolve the boundary issue quickly as "respect for each other's sensitivities and concerns and, peace and stability in our relations and along our borders are essential." The Chinese president said that he too was ready to end the row, and repeated Beijing's stand that the boundary dispute has been left over from history.
China was more magnanimous on economic issues. Mr Xi promised that Indian companies and products - especially including those made by the pharmaceutical, farming and fuel industries - will be given greater access to Chinese markets, in a bid to bridge the yawning trade deficit between the two countries. China pledged $20 billion of investment for the next five years, which should be compared with the $400 million that it has invested in India over the last 14. This was part of a five-year trade and economic cooperation agreement with China with a view to improving the trade balance. A $6.8-billion deal to establish two industrial parks aimed at reducing trade imbalances was also signed.
The visit clearly was not as substantive as many were hoping for. But this is the new normal in Sino-Indian ties. Rhetoric aside, keeping India's ties with China on an even keel is a challenge for Indian policymakers. And it is here that Narendra Modi has an advantage. Beijing views Mr Modi as a strong leader who can deliver. An early outreach to him was, therefore, seen as essential in making sure that Delhi does not gravitate rapidly to an emerging anti-China coalition in the larger Indo-Pacific as the US fashions its strategic rebalance to the region.
Much like Mr Modi, Mr Xi is also a strong nationalist leader who has a hard-line orientation on national security but remains eager to co-operate on economic issues. Mr Modi's room for diplomatic manoeuvring is considerably higher than that of his predecessor, Manmohan Singh, who was constrained by his lack of political authority and his party's seeming foreign policy ineptitude. Where the Congress Party has been paralysed by an almost irrational fear of offending Chinese sensitivities and in the process ended up jeopardising Delhi's ties with its partners like Japan and the US, Mr Modi has taken a more confident position from the very time he assumed office.
Where he has openly talked of Chinese "expansionism" and has started taking concrete measures to insulate India from the negative effects of China's rapid military modernisation, he has also made it clear that he would be going all out to woo Chinese investments into India. Mr Modi's energetic diplomacy in his first few months in office seems to have put China on notice that Delhi is not without options in a rapidly evolving global geostrategic context. It has increased India's strategic space. Mr Modi should now leverage this in his engagement with Beijing.
After welcoming Mr Xi to India, Mr Modi will be going to the US, where he should try to impart a new dynamism to Indo-US ties. These have been losing momentum for several years now under a lacklustre Congress government and an Obama administration that has been consumed by multiple crises in various parts of the world with little time for India. Mr Modi has already started the process of re-engaging India's immediate neighbours, and giving a new sense of purpose to India's ties with like-minded states such as Japan, Australia and Vietnam. India's China policy will be effective only when India manages to get its other bilateral relationships in order. Managing China and its ubiquitous rise is not going to be easy for India. But the Modi government, with its decisive mandate, can certainly bring a sense of normalcy to this vital relationship.
The writer is at King's College, London