India’s Prime Minister Narendra Modi and China’s President Xi Jinping preside over two of Asia’s biggest economies, each with a population well over 1 billion.

But when the two leaders met for a summit this week in India, their handshakes and pledges of cooperation were overshadowed by a mere 1,000 soldiers and a group of yak herders miles away on a windswept Himalayan plateau. There, in a remote region called Ladakh, soldiers and civilians had been engaged in two border disputes that lasted for days.

The incidents overcast a visit that was trumpeted by both sides as a “historic” occasion, the first by the Chinese president since Modi became prime minister in May. Since then, Modi has faced the dual challenge of strengthening his country’s relations with other neighbors, especially Japan, while pressing for greater investment from the Chinese, crucial to his plan to modernize and expand India’s infrastructure.

On the second day of talks Thursday, leaders for the two countries announced a partnership to improve Indian railways and China’s $20 billion investment in two industrial parks in the western states of Gujarat and Maharashtra.

Xi, in his remarks, said that Chinese companies would partner with India to improve railway speeds and open market access in China for India products such as pharmaceuticals, agricultural goods and fuel. The two trade more than $66 billion annually, the majority in Chinese exports.

Modi, for his part, lauded the economic partnerships but said he had “raised serious concern over repeated incidents along the border” during the 90-minute meeting with Xi at Hyderabad House in New Delhi.

“We agreed that peace and tranquility in the border region constitutes an essential foundation for mutual trust and confidence and for realizing the full potential of our relationship,” Modi said. He called for the two countries to clarify the border demarcation — known as the Line of Actual Control — a process that has been “stalled” for years.

The two countries have been feuding over their 2,200-mile border since they fought a brief war in 1962, and troops have often scuffled over territory.

Analysts said the standoff of soldiers in Chumar, sparked by the construction of a new road on the Chinese side, was one of the most intense in recent memory. In addition, Chinese yak and pony herders have allegedly pitched tents on Indian territory near the village of Demchok.

Late Wednesday, Indian media reported that the troops in Chumar had begun to stand down, leaving some analysts mystified about the mixed messages China was sending — a show of military strength along the border that coincided with Xi’s efforts at one-on-one diplomacy.

“It overshadowed the visit for sure,” said military analyst Ajai Shukla. “It forced the Modi government to take a harder line and took attention away from the meeting completely.”

Xi, in his comments, pledged to work with “friendly cooperation” to settle the boundary question “at an early date.”

Modi, who until recently was the chief minister in Gujarat, chose to host Xi’s arrival in his home state Wednesday. Modi had campaigned on Gujarat’s economic success, which was bolstered by foreign investment from Chinese companies and elsewhere.

On Wednesday, the two men visited the ashram where Mohandas Gandhi lived and sat in a swing on the recently built riverwalk in the commercial capital of Ahmedabad, one of the state’s centerpiece development projects.

“The visit was rich in symbolism but underwhelming in substance,”said Brahma Chellaney, professor of strategic studies at the Center for Policy Research in New Delhi. He noted that the $20 billion investment promise was unlikely to be met, given that China’s cumulative investment in India is less than $500 million, according to Indian government figures, a fraction of China’s $30-plus billion yearly trade surplus with India.

In China, media focused on the personal relationship between the two leaders, and editorials and commentaries emphasized the similarities between the two countries — how they were both ancient civilizations, supported each other in fighting for independence and are in the process of national “rejuvenation,” as Xi put it Thursday. The Global Times published an editorial saying that India-China cooperation could fundamentally change the world in the face of Western hegemony.

Hallie Gu contributed to this report from Beijing.