India and China are close to an agreement to stop tension on their contested border touching of confrontation while they try to figure out a way to break decades-old stalemate on overlapping claims to long stretches of the Himalayas.
The border defence cooperation pact that diplomats are racing to finalise ahead of Prime Minister Manmohan Singh's visit to China next week is a small step forward in a complicated relationship marked by booming economic ties but also growing distrust.
In May, the two armies ended a three-week standoff in the western Himalayas after Chinese troops set up a camp at least 10 km (6 miles) inside territory claimed by India, triggering a public outcry and calls that India should stand up to its powerful neighbour.
China denied that troops had crossed into Indian territory.
Under the new agreement, the two nuclear-armed sides will give notice of patrols along the ill-defined border. They will ensure that patrols do not "tail" each other to reduce the chance of confrontation.
The two armies, strung out along the 4,000-km (2,500-mile) border from the high altitude Ladakh plateau in the west to the jungles of Arunachal Pradesh in the east, have also agreed to set up a hotline between top ranking officers, in addition to existing brigade-level contacts.
"The key issue is maintaining peace and tranquillity on the border," said an Indian government official.
The border defence cooperation agreement is built on existing confidence-building measures and is designed to ensure that patrolling along the Line of Actual Control, as the unsettled border is called, does not escalate into an unintended skirmish, he said.
"Barring last minute problems, there should be an agreement. It's a question of crossing the Ts and dotting the Is," the officer said, speaking on condition of anonymity because of the sensitivity of the issue.
India and China fought a brief border war in 1962 and since then ties have been mired in distrust. China lays claims to more than 90,000 square km (35,000 sq miles) of land in the eastern sector. India disputes that and instead says China occupies 38,000 sq km (14,600 sq miles) of territory on the Aksai Chin plateau in the west.
A Chinese airline last week blocked two Indian archers from disputed Arunachal Pradesh from travelling to China, souring the mood in India just days before Singh travels to Beijing.
"The fundamental problem they are not tackling is defining the Line of Actual Control and then a settlement of the border," said Srikanth Kondapalli, a China expert at New Delhi's Jawaharlal Nehru University.
BEEFING UP DEFENCES
One reason tension has risen is that both countries are upgrading civil and military infrastructure on either side of the frontier.
China has vastly improved its roads and is building or extending airfields on its side of the border in Tibet. It has placed nuclear-capable intermediate missiles in the area and deployed about 300,000 troops across the Tibetan plateau, according to a 2010 Pentagon report.
India has also woken up and is in the midst of a 10-year plan to scale up its side of the border with a network of roads and airfields. In July, the cabinet cleared the raising of a new mountain corps comprising about 50,000 troops to be deployed on the Chinese border.
"China has developed the border infrastructure so intricately that its roads and tracks even in high mountainous regions look like fingers running down your spine," said retired Lieutenant General Prakash Katoch who commanded the Indian army's Special Forces wing.
Chinese nuclear and missile assistance to Pakistan as well as a widening trade deficit in China's favour have added to Indian fear about encirclement. China, on the other hand, is concerned about Tibetan activists using India as a base to further their separatist aims.
"It strikes me that many of the usual grievances have grown in prominence over the past several months: Chinese incursions on the border, the issuance of irregular visas, continued Chinese support for Pakistan's nuclear programme, and so on," said Shashank Joshi, a fellow at the Royal United Services Institute in London.
"It also seems that India is eager to keep these grievances in check."