ON JUNE 18th Indian army troops marched across an international border to block the progress of a group of Chinese border guards. Seven weeks on, the tricky question is which border they crossed. The Indians set out from the state of Sikkim; the dispute is whether they entered the tiny mountain kingdom of Bhutan or instead walked straight into Chinese territory. Near a “tri-junction” where the boundaries separating India, China and Bhutan all meet, reinforcements of several hundred Chinese and Indian soldiers have been facing off ever since, locked in a showdown over a scrubby patch above the treeline. Every day Indian and Chinese newspapers exchange hawkish bluster, but their political leaders and diplomats are barely speaking to one another. China insists that India withdraw its troops before any conversation about the border can even begin. How did things come to this high-altitude impasse?

The site of the deadlock between China and India is a bowl-shaped plateau in a region called Doklam. In many respects it is typical of the immense border shared between the two Asian giants. Himalayan mountains frame their 4,000-km division, all of it sparsely populated and very little of it formally demarcated. It doesn’t help that maps of the remote region are often imprecise. Incursions, most of them accidental, are frequent: even as the Doklam confrontation has simmered, a Chinese contingent was spotted briefly on Indian soil almost 1,000km away, to the west of Nepal. Caution prevails; everyone remembers the Sino-Indian war of 1962, which led to a brief but humiliating multi-pronged invasion of India. A relatively tense incursion happened in 2014, awkwardly while Xi Jinping was making his way to India for a first visit as China’s president. Most of the treaties that separate the two sides predate the existence of their modern states. Many were signed by officers of the British raj and the Qing empire.

In Doklam, the crux of the dispute is a self-contradictory old treaty, signed in 1890. It defines the border between China and Bhutan by means of a watershed, but also by reference to several mountain passes. India and Bhutan claim that the watershed fixes the tri-junction at a pass called Batang-La. But the same treaty also mentions another pass further south, called Gymochen. The standoff was ignited by Chinese roadbuilders who seemed to be preparing to pave over a dirt track to Gymochen, which China regards as the southern extent of its claim. The pass occupies a ridge commanding a view to the Siliguri Corridor, also known as “chicken’s neck”, a strategically important sliver of India which connects the Indian north-east to the rest of the country. So India intervened not only on behalf of Bhutan but also with its own security in mind. It maintains that a blacktopped road represents too much of a change to the status quo agreed between the two big players for China to be allowed to make it unilaterally. China calls the Indian view an outrage.

Though neither country wanted the standoff, there is now no clear way to resolve it. Neither side can simply withdraw its soldiers without losing face; some clever diplomatic compromise is needed. The solution might lie with tiny Bhutan, which has no diplomatic ties of its own with China and which India has tended to treat as an extension of itself. If royal Bhutanese troops were to stand in for the Indians, the Chinese might be able to move back their own threatening presence, and all sides could declare victory. However, the solution would come at an immediate cost to India if it led Bhutan any closer to establishing its own relations with China.