Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Nuclear-armed rivals Pakistan and India are locked in the worst crisis in years over the disputed region of Kashmir, and the capture of an Indian fighter pilot could mean the confrontation will only get worse, former diplomats and regional analysts say.

The pilot, wing commander Abhinandan Varthaman, was in Pakistani military custody after his MiG 21 was shot down on Wednesday along the disputed border between the two countries.

India's Prime Minister Narendra Modi now faces a crucial crossroads, experts said, faced with either holding back and seeking to settle the dispute, or taking further military action. With elections in less than three months in India, hitting back at Pakistan could play well to nationalist sentiment — but it could also risk a full-blown war.

"New Delhi is in a really tough spot now," said Michael Kugelman, deputy director of the Asia Program at the Wilson Center, a Washington think tank. "Domestic political considerations make it very unlikely that India would want to de-escalate right now."

In any talks with Pakistan, which India has so far rebuffed, the captured pilot would give Islamabad valuable leverage and make it difficult for New Delhi to drive a hard bargain, Kugelman said.

The hostilities began with a suicide car bomb attack this month that left 40 Indian paramilitary police dead in the Indian-controlled side of Kashmir, one of the worst attacks in years against India. New Delhi responded with an airstrike on Tuesday, but this time India chose to strike inside Pakistani territory. The operation targeted what India said was a terrorist training camp for Jaish-e-Mohammad, the militant group that claimed responsibility for the Feb. 14 attack.

On Wednesday, Pakistan retaliated by shooting down at least one Indian fighter jet while trying to attack Indian military sites along the de facto border.

Pakistan aired footage of the purported Indian pilot, blindfolded at one point and then thanking his captors for rescuing him from a mob after his plane was downed. India expressed outrage over what it called "Pakistan's vulgar display," accusing it of violating the Geneva Conventions and warning it not to harm the pilot.

Summoning Pakistan's envoy in New Delhi, India said that it "reserves the right to take firm and decisive action to protect its national security, sovereignty and territorial integrity against any act of aggression or cross-border terrorism."

With an outpouring of nationalist sentiment in both countries and an election looming in India, political pressures will make it difficult for both governments to find a face-saving way to defuse the tension, said Husain Haqqani, Pakistan's former ambassador to the U.S. and now a fellow at the Hudson Institute.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"What we have actually is a confluence of domestic political factors that make a sensible outcome difficult," Haqqani told NBC News. "There are calls in India to teach Pakistan a lesson over its support for terrorism. And there are calls in Pakistan to teach India a lesson about how it cannot dictate to Pakistan."

Pakistani protesters attend an anti-Indian rally in Peshawar, Pakistan on Feb. 26, 2019. Muhammad Sajjad / AP

Social media was also ratcheting up nationalist anger in both countries, he said. "Right now it's not just nuclear weapons that we have to worry about, but social media which feeds hyper-nationalist frenzy on both sides," Haqqani said. "That frenzy makes reasonable diplomacy very difficult."

In its response to the suicide bombing in Kashmir, India's government seemed to signal a tougher approach by choosing to hit back inside Pakistani territory.

"Certainly, by undertaking a version of 'hot pursuit,' India sought to establish new rules," said Rafiq Dossani of the Rand Corp., a think tank.

The capture of the Indian military pilot "has increased Modi's vulnerability and, in my opinion, greatly raised the risk of escalation," Dossani said.

The U.S. and China have helped tamp down tensions between Islamabad and New Delhi in previous crises, but it was unclear if Washington and Beijing would be able to exert similar influence this time. The Trump administration only recently named a nominee for the top State Department position overseeing diplomacy in South Asia, and it has not appointed an ambassador to Pakistan.

U.S. Secretary of State Mike Pompeo called for restraint in phone calls Tuesday with his Indian and Pakistani counterparts, warning both governments "to avoid escalation at any cost."

But Pompeo echoed concerns from India and European governments, stressing the "urgency of Pakistan taking meaningful action against terrorist groups operating on its soil."

Pakistan has long rejected accusations that it is harboring militants who stage attacks against India. And Pakistan's prime minister, Imran Khan, who won election last year with the support of the country's powerful military, cannot afford to alienate the top brass or hard-line nationalists, experts said.

Although Pakistan's armed forces clashed with India along the border in recent days, Khan, the cricket-star-turned-politician, struck a conciliatory tone on Wednesday, calling for calm and for dialogue. "We should sit down and talk," Khan said.

But Khan lacks the political capital to tackle the problem posed by Islamist militants, in a country where there is considerable sympathy for the militants' viewpoint, experts said.

"The new prime minister simply can't say anything that the military doesn't want him to say. He wants to sound reasonable, but he is unable to acknowledge terrorist safe havens in Pakistan are a problem," Haqqani said.

The current crisis is all the more worrying given a major arms buildup on both sides over the past 20 years. Reinforced by its growing economic might, India has invested heavily in its conventional forces and recently deployed its first nuclear-powered submarine armed with nuclear missiles.

Pakistan, meanwhile, has the fastest growing nuclear stockpile in the world, according to the Nuclear Threat Initiative, with an increasingly sophisticated array of missiles.

In a worldwide threat assessment delivered to Congress earlier this month, the U.S. intelligence community warned that new types of nuclear weapons in Pakistan and India "will introduce new risks for escalation dynamics and security in the region."

Both countries have about 140-150 warheads each, but Pakistan lacks a clear doctrine governing the arsenal and has never ruled out a first strike, according to arms control experts. While India has long-range strategic nuclear weapons, Pakistan has placed a priority on tactical weapons, including rocket launchers with short ranges of about 45 miles, experts said.

With India holding a decisive advantage in conventional arms, Pakistan has long looked to its nuclear weapons as a way to deter a potential invasion by its much larger neighbor, said Henry Sokolski, executive director of the Nonproliferation Policy Education Center and a former Pentagon official.

"The Pakistanis see early use of nuclear weapons as a way to prevent major conventional incursions, whereas the Indians are all about operating below the nuclear threshold," Sokolski said. "That is a prescription for mischief."

Hans Kristensen, director of the nuclear information project at the Federation of American Scientists, said the divergent doctrines carry the risk of an unintended escalation, precisely at moments such as the current crisis. The fear is the "entanglement between conventional and nuclear forces," he said.

Indian fighter aircraft used in recent operations "came from one of the bases that we believe has a nuclear mission — Gwalior Air Force Base," Kristensen said. "The Pakistanis know that and if this continues to escalate, there could be confusion, particularly if the Indians start to take territory."

He added, "I don't want to say Pakistan is more trigger happy, but let's say they are more ready to use nuclear weapons."