Chinese President Xi Jinping on Tuesday sought to move past a tense border dispute with Indiainfo-icon, telling Prime Minister Narendra Modi that the two nuclear-armed neighbours should pursue "healthy, stable" relations, according to Chinainfo-icon's state mediainfo-icon.

The exchange occurred on the sidelines of the just-ended summit of BRICS emerging economies hosted by Xi in the southeastern Chinese city of Xiamen.

Xi told Modi that "healthy, stable bilateral ties" were "in line with the fundamental interests" of the neighbours, said the official Xinhua news agency.

"China is willing to work with India on the basis of the Five Principles of Peaceful Coexistence which were put forward by both countries to improve political mutual trust, promote mutually beneficial cooperation, and push Sino-Indian ties along a right track," the report quoted him as saying.

An Indian foreign ministry spokesman also tweeted that the two leaders had a "constructive and forward-looking" talk.

Armed forces of the two countries engaged in a bitter, weeks-long military confrontation in a disputed and strategically important Himalayan area.

The contested area, Doklam, is claimed by both China and Bhutaninfo-icon, an ally of India.

The stand-off began on June 16 when Chinese troops started building a road in the area.

India deployed troops to stop the construction project, prompting Beijing to accuse it of trespassing on Chinese soil and sparking one of the worst crises in decades between the two countries, which have a historyinfo-icon of mistrust.

The confrontation dragged on as China repeatedly demanded India withdraw its troops before any proper negotiation could take place, while India countered that both sides should withdraw their forces together.

They backed off only last week, possibly to prevent the dispute from marring the summit of the five-nation BRICS, which also includes Brazilinfo-icon, Russiainfo-icon and South Africainfo-icon.

The summit had been carefully stage-managed by hosts China to project an image of developing-worldinfo-icon solidarity.

New Delhiinfo-icon announced early last week that both countries were pulling back their border forces, while Beijing said only that India had withdrawn "all its border personnel and equipment that were illegally on the Chinese territory".

Afterwards, Chinese Foreign Minister Wang Yi said that Beijing "hopes the Indian side will learn lessons from this incident and prevent similar things from happening again".

India does not claim Doklam for itself but is closely allied with Bhutan, which it regards as a buffer against rival China to the north.

India and China have a long history of mistrust and went to warinfo-icon in 1962 over the Indian state of Arunachal Pradesh.