In Pakistan, dozens of tanks were deployed to the border in broad daylight, underscoring the heightened state of alert as both sides scrambled to shore up their military positions. Such equipment usually is moved under the cloak of night.

India’s government confirmed that one of its MiG-21 fighter jets had been “lost” as it thwarted what the government said was an attempt by Pakistan’s air force to strike an unspecified target inside India. In the encounter, a Pakistani aircraft was shot down by an Indian fighter jet, New Delhi said, a claim that Pakistan denied.

Raveesh Kumar, the chief spokesman for India’s Ministry of External Affairs, told a news conference in New Delhi that the government was still “ascertaining the facts.” He did not respond to Pakistan’s claims of having downed two aircraft, instead of the single jet he acknowledged. He declined to take questions.

Although both India and Pakistan say they want to resolve the current crisis diplomatically, the two governments may be beholden to their electorates, amid calls for firm military responses from both sides of the border. In Pakistan, with the capture of the Indian pilot, the current crisis has shored up support for Mr. Khan, who took office six months ago and has since faced growing opposition domestically.

The crisis has not presented such an opportunity for Mr. Modi, who seemed destined just a year ago to clinch a second term as India’s prime minister. Since then, Mr. Modi has faced considerable opposition over what critics say is his mishandling of the economy ahead of the elections this spring. The capture of the Indian pilot may only weaken his position and lead to a dangerous escalation if Mr. Modi chooses to respond militarily.