For now, both governments appear committed to containing their disagreements and building stronger economic ties. China’s ambassador to New Delhi, Le Yucheng, had said the deals signed during Mr. Modi’s visit could be worth $10 billion. Mr. Li, China’s premier, mostly avoided delicate policy areas in his comments to reporters, and he praised Mr. Modi’s efforts to reinvigorate the Indian economy and to improve relations with China.

“It’s clear that the Chinese government is going out of its way to demonstrate that it takes India and Narendra Modi in particular seriously,” said Peter Martin, an associate director in the New Delhi office of APCO Worldwide, a consultancy. “The challenge, of course, is making such rhetoric seem credible when the border dispute dominates public debate, especially in India.”

One indicator of good will was the absence of confrontation on the countries’ 2,200-mile border, much of it poorly defined and contested. Last September, as Mr. Modi and Mr. Xi entered their first meeting, Indian soldiers faced off against Chinese troops in the Himalayas.

On Friday, Mr. Modi said India wanted closer ties with China, including more investment, greater access to its markets and a shared commitment to ensure that their disagreements remained in check.

In the afternoon, addressing students at Tsinghua University, he presented a broad argument for cooperation: Both China and India face extremist terrorism whose “source is in the same region,” and uncertainty about energy supplies. He noted that the countries depend on the same sea lanes for international commerce, a point of sensitivity for China, which fears losing sea access for fuel imports in the event of hardening conflict with the United States or its allies.

India and China remain sensitive to any perceived challenges to territorial claims and affronts to national pride. Before Mr. Modi’s visit, for example, Indian news outlets seized on a commentary in a popular Chinese tabloid, Global Times, that accused Mr. Modi of “playing little tricks over border disputes and security issues.”