The sparring between India and Pakistan last month threatened to spiral out of control and only interventions by U.S. officials, including National Security Advisor John Bolton, headed off a bigger conflict, five sources familiar with the events said.

At one stage, India threatened to fire at least six missiles at Pakistan, and Islamabad said it would respond with its own missile strikes “three times over”, according to Western diplomats and government sources in New Delhi, Islamabad and Washington.

The way in which tensions suddenly worsened and threatened to trigger a war between the nuclear-armed nations shows how the Kashmir region, which both claim and is at the core of their enmity, remains one of the world’s most dangerous flashpoints.

The exchanges did not get beyond threats, and there was no suggestion that the missiles involved were anything more than conventional weapons, but they created consternation in official circles in Washington, Beijing and London.

Reuters has pieced together the events that led to the most serious military crisis in South Asia since 2008, as well as the concerted diplomatic efforts to get both sides to back down.

The simmering dispute erupted into conflict late last month when Indian and Pakistani warplanes engaged in a dogfight over Kashmir on Feb 27, a day after a raid by Indian jet fighters on what it said was a militant camp in Pakistan. Islamabad denied any militant camp exists in the area and said the Indian bombs exploded on an empty hillside.

In their first such clash since the last war between the two nations in 1971, Pakistan downed an Indian plane and captured its pilot after he ejected in Pakistan-controlled Kashmir.

Hours later, videos of the bloodied Indian pilot, handcuffed and blindfolded, appeared on social media, identifying himself to Pakistani interrogators, deepening anger in New Delhi.

With Prime Minister Narendra Modi facing a general election in April-May, the government was under pressure to respond.