Washington (CNN) The US called for restraint after long-standing rivals India and Pakistan launched airstrikes against each other for the first time since 1971, raising fears of an escalating conflict between the two nuclear powers.

Both countries declared Wednesday that they don't want further conflict, but with an untested leader in Pakistan and India's nationalistic prime minister facing elections and under pressure to take a tough stand, the risk of retaliatory action remains high, analysts said.

Pakistani Prime Minister Imran Khan, speaking directly to India during a Wednesday address to the nation, posed a question to its government: "Given the arms that we and you have, can we afford any miscalculation? Should we not be thinking that if this escalates, where will it lead to?"

The Indian Foreign Ministry issued a statement saying it had called on Pakistan's representative to its country. "It was clearly conveyed that India 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," the statement said.

The stakes have led the US, China, Australia, the UK and others to urge calm. Secretary of State Mike Pompeo called on both sides late Tuesday "to avoid escalation at any cost" and communicate directly.

Pompeo said in a statement that he had emphasized to India's minister of external affairs "our close security partnership and shared goal of maintaining peace and security in the region," and told Pakistan's foreign minister he wanted "to underscore the priority of de-escalating current tensions by avoiding military action, and the urgency of Pakistan taking meaningful action against terrorist groups operating on its soil."

"We encourage India and Pakistan to exercise restraint, and avoid escalation at any cost," Pompeo said. "I also encouraged both Ministers to prioritize direct communication and avoid further military activity."

The top US diplomat, in Vietnam for President Donald Trump's talks with North Korean leader Kim Jong Un, conferred with acting Defense Secretary Patrick Shanahan, who has been focused on de-escalating tensions and urging both nations to avoid further military action, according to Pentagon spokesman Lt. Col. Dave Eastburn.

Shanahan's outreach on the flare-up along the de facto border in the disputed state of Kashmir underscores the urgency of the situation. The acting defense secretary has also been in contact with national security adviser John Bolton, Chairman of the Joint Chiefs of Staff Joseph Dunford, the commander of the US Navy's Indo-Pacific Command, Adm. Philip Davidson, and Gen. Joseph Votel, the head of US Central Command.

Dangerous dynamics

Domestic dynamics in both countries may make it hard for them to stand down.

On Wednesday, the two sides couldn't even agree on what exactly had happened as they grapple with the fallout of a February 14 terror attack on Indian security forces in Indian-controlled Kashmir that left 40 paramilitary soldiers dead. The suicide car bombing was claimed by Jaish-e-Mohammed, a militant group.

On Monday, India retaliated, sending fighter jets across the disputed border with Pakistan and dropping bombs for the first time since the two countries were at war in 1971, targeting the militant camp in Pakistani territory. Pakistan denies India struck any camp, but the next day, Islamabad sent its air force into Indian territory and said it shot down two Indian jets. India acknowledges the incident, but says only one of its planes was downed and a pilot is missing.

The Indian Foreign Ministry said it's "unfortunate that instead of fulfilling its international obligation and bilateral commitment to take credible action against terrorist entities and individuals operating from its soil, Pakistan has acted with aggression against India."

Dunford spoke by phone with Pakistan's defense chief on Tuesday following India's airstrikes on the alleged terrorist training camp in Pakistan, a spokesman said.

Pakistan's newly appointed ambassador to the US, Dr. Asad M. Khan, said the attack had been carried out by local Kashmiri groups and that there is no "alleged terrorist camp."

"Pakistan also retains the reciprocal right to retaliate ... against acts of terror against Pakistan," Khan said, speaking to reporters Wednesday.

Both nuclear-armed states claim all of Kashmir, the disputed territory where the clashes occurred, but control only parts of it. Of the three wars India and Pakistan have fought since the area gained independence from Britain in 1947 and was split into two countries, all but one have been about Kashmir.

Indians took the streets to demand that Prime Minister Narendra Modi retaliate for Pakistan's strikes and his political base has echoed that call. The Indian prime minister faces elections in April and May, a lackluster economy and a need to recover from an anemic showing in state-level voting last year.

That constellation could make it hard for Modi to resist the opportunity to hit back hard again, and "capitalize on his strongman image and national security credentials to boost" his party in the elections, noted Akhil Bery, an analyst at the Eurasia Group.

The Pakistani prime minister, who assumed the role in August, called for an emergency meeting of the security body that controls the country as well as for dialogue with India.

But Bery said India has "little interest" in accepting that olive branch or in dialogue "because it would probably cost Modi domestically ahead of the vote."

India is "still incensed" by the February 14 attack as well as the downing of the fighter jet, Bery said.

"Modi has continuously presented himself as willing to do whatever it takes to protect India," Bery noted. "For his base, negotiating with Pakistan is perceived as a sign of weakness. In addition, until the captured pilot is returned safely, it will be politically difficult for Modi to negotiate with Pakistan, though this will not increase the risk of retaliation."

"Despite both countries' desire to avoid a major escalation, there remains a risk of tit-for-tat retaliatory action," Bery said.

Pakistani Ambassador Khan called on the US to facilitate.

"It's a very serious situation and any further escalation can be dangerous," Khan said, adding that "the US has historically played a role in terms of defusing or trying to defuse the tensions between India and Pakistan."

He noted tweets from US lawmakers calling on the Trump administration to be more active in defusing tensions. "How that is done is something I'll leave to the US," Khan said, "but it is a serious threat to peace and security not just for Pakistan and India but for the wider region."