Diplomacy finally won the day as India and China ended their three-week stand-off in the Daulat Beg Oldi sector in eastern Ladakh.

At the last of a series of flag meetings which took place at 4 p.m. on Sunday, commanders from both sides shook hands and ordered their troops, facing each other 300 metres away, to dismantle their tents.

This was preceded by the Ministry of External Affairs (MEA) here working the phones and Indian Ambassador to China S. Jaishankar going to the Chinese Foreign Office twice to hold talks.

While the Chinese pulled down their tents, chained their dogs and withdrew at about 7 pm, troops of the Indo Tibetan Border Police (ITBP), which had been ordered to face the Chinese troops, started falling back to their original positions. By 10 p.m., the plateau was clear of the troops and their related paraphernalia.

MEA sources said the agreement was reached at the diplomatic level, while the modalities were agreed at the flag meeting. These capped the intensive diplomatic contacts during the last few days led by Foreign Secretary Ranjan Mathai coordinating with military authorities and Mr. Jaishankar in Beijing, which led to the flag meeting on Sunday evening in which the face-to-face situation was resolved, added the sources.

Described by External Affairs Minister Salman Khurshid as acne on the otherwise pretty face of India-China relations, the end to the stand-off would enable the Minister’s preparatory visit on Thursday, for the Chinese Premier Li Keqiang’s selection of India as the first overseas stop, to take place.

India had alleged that about 40 Chinese People’s Liberation Army (PLA) troops had intruded 19 km into its territory across the line of actual control (LAC) on April 15. They set up tents in the Daulat Beg Oldi sector and were matched by an equal strength of ITBP troops being asked to set up tents 300 metres away.

China denied the charges, maintaining that its troops remained within its own territory.

Contrary to media reports, the two armies held a large number of flag meetings and not four as reported, to keep the dialogue going. This supplemented talks between the two sides under the aegis of a recently created Joint Mechanism set up after two years of deliberation for precisely this purpose and daily conversations between Mr. Jaishankar and the Chinese Foreign Office.

While the political leadership remained sanguine about resolving the stand-off, the extended stalemate on the 17,000-foot high plateau led to a section of strategic analysts and media doubting the future of India-China ties that have expanded to include consultations in several areas such as Afghanistan, terrorism, anti-piracy and ocean bed research.