India and China have agreed to improve communication between their militaries to maintain peace at the border, India's foreign secretary said on Saturday at the end of an ice-breaking trip to China by Prime Minister Narendra Modi.

Modi has spent the past 24 hours in the central Chinese city of Wuhan for informal meetings with President Xi Jinping, months after a dispute over a stretch of their high-altitude Himalayan

border rekindled fears of war between the Asian nations.

Indian Foreign Secretary Vijay Gokhale told reporters after Modi and Xi wrapped up their talks that both leaders had agreed their two countries had the maturity and wisdom to handle all their differences peacefully through talks.

"On the issue of the India-China boundary question, the two leaders endorsed the work of the special representatives in their efforts to find a fair, reasonable and mutually acceptable settlement," he said.

"And the two leaders also underscored that in the meantime it is important to maintain peace and tranquillity in all areas of the India-China border region," Gokhale said.

Billed by both sides as an informal meeting rather than a summit, with none of the pomp and ceremony of a state visit such as 21-gun salutes, the two men held talks on Friday that lasted far longer than expected. It also included a personal tour of a major museum by Xi.

Chinese state media has praised the tone of the trip.

The overseas edition of the ruling Communist Party's official People's Daily said in a front page commentary on Saturday "two great countries ought to have great cooperation," and showed a large picture of the two leaders shaking hands.

"There is reason to believe that this Wuhan meeting will increase mutual trust, manage and control disputes, deepen cooperation and lead to a new phase in China-India relations," it said.

"It is quite clear that strategic agreement between the two countries far exceeds the specific differences, and the need for cooperation far exceeds local friction," it said.

The official China Daily said in an editorial there was no denying mutual suspicion was keeping the two countries from working together.

"Yet neither Beijing nor New Delhi calls the other an enemy, which means both expect bilateral ties to improve. Indeed, China and India are natural partners," it said.

Despite the upbeat statements, which on Friday included Modi inviting Xi to India for a similar informal summit next year, the nations' differences are significant.

As well as disputes over stretches of a 3,500 km (2,200 miles) border, they are bumping up against each other in the Indian Ocean and squabbling over Xi's signature Belt and Road infrastructure initiative.

India signaled as recently as Tuesday its opposition to the grand trade and transport plan because one of its branches runs through Pakistani-administered Kashmir, which India claims.

India has long been suspicious of China's traditionally close ties with Pakistan.

For its part, China has been concerned about U.S. efforts to draw India into a maritime "quad" of democracies, including Japan and Australia.

China is also suspicious of India's hosting of the Dalai Lama and other exiled Tibetans.