The border row had cast a cloud over Foreign Minister Salman Khurshid's China visit this week and that of new Chinese premier Li Keqiang to India later this month.
"Both sides reached an agreement on Sunday night after a meeting was held between border commanders. We will withdraw our troops and China will do the same," a senior Indian army official told a news agency and confirmed today by the ministry of external affairs.
Around 50 Chinese soldiers and the jawans of Indo-Tibetan Border Police began formal withdrawal at 7 pm and completed the area by 10 pm. The Chinese pulled down their tents close to an Indian military airstrip.
News of the withdrawal came after Khurshid had hinted that he could cancel a planned trip to Beijing this week if there was no settlement.
With the resolution of the dispute, Khurshid would be travelling to Beijing as scheduled on May 9 where he would "discuss bilateral, regional and global issues of concern" with Chinese counterparts. This would also mean that the Chinese prime minister's first overseas visit would be to India.
The informal border separating China and India is known as the Line of Actual Control (LAC). While it has never been formally demarcated, the countries have signed two accords to maintain peace in frontier areas.
How it was resolved
The two armies held a large number of flag meetings to keep the dialogue going. This was supported by the two sides holding talks under the arrangement called Joint Mechanism and daily conversations between Indian Ambassador S Jaishankar and the Chinese Foreign Office.
At the last of a series of flag meetings which took place at 4 pm on Sunday, the commanders from both sides shook hands and ordered their troops, facing each other 300 metres away, to dismantle their tents.