Image copyright AFP Image caption An Indian soldier on the China border - Beijing has reiterated what it says is its right to territory

China says India has withdrawn troops from a disputed Himalayan border area, ending a tense stand-off lasting weeks.

The foreign ministry in Beijing said it was pleased that "trespassing Indian personnel have all pulled back to the Indian side of the boundary".

India's foreign ministry confirmed troops were "disengaging" at Doklam after agreement between the countries.

The row began in mid-June when India said it opposed a Chinese attempt to extend a border road on the plateau.

The area is known as Doklam in India and Donglang in China.

The news comes a week before a visit to China by Indian Prime Minister Narendra Modi.

The plateau, which lies at a junction between China, the north-eastern Indian state of Sikkim and the Himalayan kingdom of Bhutan, is disputed between Beijing and Bhutan. India supports Bhutan's claim over it.

Earlier on Monday China made clear it would "continue its sovereignty rights" in the area.

Foreign ministry spokeswoman Hua Chunying said Chinese troops had verified on ground that Indian personnel had withdrawn in the morning.

A senior Indian government source told the BBC that both sides had pulled out "personnel and equipment" from the area.

'Win for China' ahead of summit

Robin Brant, BBC News, Shanghai

China's president is about to host India's prime minister, among others, at a summit this weekend. No-one likes a reignited border dispute to spoil a showpiece event, especially the Chinese.

But state media here see this as a clear win, referring to Indian troops as "trespassing".

One of the most eye-catching things about this latest stand-off is how it started - road building. China has a vast infrastructure strategy unfurling beyond its western borders but some critics say the One Belt, One Road plan isn't just about economics.

To some the Doklam dispute looked like it fitted this analysis; the army builds a road to establish a physical presence to justify a historical claim. Not dissimilar to the highly controversial island-building China has engaged in for years now in the South China Sea, some said.

Then there's Pakistan, India's arch enemy. It's currently the second biggest recipient of Chinese infrastructure investment. Evidence of a strategy aimed at expanding China's influence around the Indian Ocean, as well as around India.

India will be relieved it's over

Sanjoy Majumder, BBC News, Delhi

It might appear as a major victory for China and a climbdown for India - but that is not how Delhi sees it.

The Indian foreign ministry says the troop pullout is a result of sustained diplomatic efforts behind closed doors over weeks and a senior government official described it as "an honourable draw".

There's no way of verifying what's happening on the ground - and little detail of any concessions that either side may have made. But few doubt that the Indian government will be relieved the stand-off is over without it escalating into a major military confrontation, given China's overall superiority.

One question remains - will the road that started this dispute now be built or abandoned?

In the weeks since the row broke out in June, both countries increased troop numbers and even engaged in several minor confrontations in the area.

Both countries also called on each other to back down, with China in particular warning of "serious consequences".

Atul Bhardwaj, adjunct fellow at the Institute of Chinese Studies in Delhi, told BBC News that an agreement was the "only alternative" since a confrontation between the two Asian giants "could not have gone on".

He added that the resolution showed "India had initially given primacy to its relationship and commitments to Bhutan" but officials had clearly changed their mind.

"India needs Chinese markets and Chinese investments," he said, adding it would be interesting to see the political fallout of the decision in India, given that Delhi had said it would not back down.

India and China fought a war over the 3,500km (2,174-mile) shared border in 1962, and disputes remain unresolved in several areas, causing tensions to rise from time to time.