India and Pakistan showed resolve and restraint this week as tensions flared between the nuclear-armed rivals but crucial underlying problems still need to be addressed, according to a former U.S. ambassador to Pakistan.
Military planes from both sides carried out tit-for-tat air strikes this week in each other's territories while their troops traded fire along the de facto border in Kashmir. The escalation was triggered after terror group Jaish-e-Mohammed claimed responsibility for an attack in India-controlled Kashmir on Feb. 14 that killed more than 40 Indian security officers.
New Delhi and Islamabad also claimed to have brought down each other's military jets and Pakistan announced an Indian pilot was captured into its custody.
On Thursday, Pakistani Prime Minister Imran Khan announced that as a "peace gesture," he would release the pilot, Abhinandan Varthaman, as early as Friday. The move was welcomed by the chiefs of India's three armed forces during a joint press conference Thursday evening — but they would not say if New Delhi considered the return a de-escalation in the conflict.
Still, Thursday's developments prompted many to hope that both countries will stop the situation from spinning out of control, especially into a full-blown armed conflict.
"I think both leaders had to show two things: Each of them had to show resolve, and each of them, fortunately, showed restraint. That is to say both sides said that they would not be pushed around by the other," Cameron Munter, CEO and president at the EastWest Institute, told CNBC's "Squawk Box" on Friday. Munter was also the former U.S. ambassador to Pakistan between 2010 and 2012.
Both sides have presented conflicting information from Tuesday's incident: A senior Indian government official source told Reuters that 300 militants were killed, but Pakistan said there were no deaths from India's bombing.
Munter, who said India's air strike inside Pakistan did not lead to any casualties, pointed out it was a sign of restraint on New Delhi's part. "And the restraint on the Pakistani side was not to gloat but to actually come up with Imran Khan's suggestion to turn back the pilot," he added.
India and Pakistan's conflict over the mountainous region of Kashmir dates back to 1947 when both countries became independent from British colonial rule.
The entire subcontinent was partitioned into Hindu-majority India and Muslim-majority Pakistan, which led to a mass displacement as people migrated from one country to the other. Outbreaks of communal and religious violence killed hundreds of thousands of people in the subcontinent during that time.
Jammu and Kashmir was a former princely state where a large number of people were killed and others were driven away by the violence during the partition. Since then, India and Pakistan have fought multiple wars over the region — both countries claim the region in full but control only parts of it. Many have raised concerns over violence and human rights abuses in both India-controlled Jammu and Kashmir, as well as in Pakistan-controlled Azad Kashmir and Gilgit-Baltistan region.
Speaking about India-controlled Kashmir, Munter said: "You have a mainly Muslim population and you have many hundreds of thousands of Indian troops keeping order. That's really not a sustainable or good situation."
"It's not something that Indians want other people to interfere with but until that gets solved, there's going to be a problem in Kashmir," he added.
In a recent op-ed piece with Indian newspaper Business Standard, former Indian foreign secretary Shyam Saran said that after the Feb. 14 terror attack, India must examine why so many locals get recruited by terrorist groups operating in the area.
"There have been allegations of intelligence failure but the ability to stop terrorist incidents and apprehending terrorists is most effective if the local populace is ready to provide intelligence that is relatively specific," Saran wrote. "This is possible only if there is a high level of trust and confidence between the populace and the security forces."
Pakistan's problem, according to Munter, is that no one believes they've cracked down on the groups like the Lashkar-e-Taiba — which carried out one of the worst terrorist attacks in India's history — or the Jaish-e-Mohammed, which operate in that region. India has long accused Pakistan of supporting those groups.
"Until the Pakistanis are credible in cracking down on these groups, they're going to have a problem. Because it's not every day that America and Iran, for example, stand shoulder-to-shoulder, criticizing the Pakistanis for not cracking down on terrorist groups," the former envoy said.
Political analysts agreed that this week's confrontation between India and Pakistan was a test of leadership for both Khan and Indian Prime Minister Narendra Modi, who is facing a parliamentary elections in the coming months.
The developments did not turn out well for Modi, according to Moeed Yusuf, associate vice president for the Asia Center at the United States Institute of Peace.
"He was struggling politically already and he clearly miscalculated Pakistan's response to India's initial air strike. As soon as Pakistan retaliated, he was boxed in, with his domestic opposition all over him," Yusuf told CNBC.
But Pakistan's Khan gained "tremendously" at home, Yusuf said. "Not only in terms of where this crisis may end, but he's got a lot of praise for the way he conducted himself and the tone and tenor of his speeches. This crisis has provided him a much needed fillip politically."
Right now, analysts say, the question is how India responds in the coming days.
The government will likely be very careful and would not want to appear to be going soft or backing down against its arch rival, according to Michael Kugelman, deputy director and senior associate for South Asia at the Woodrow Wilson Center.
"It can be politically disadvantageous ... to appear to not be tough with Pakistan," he told CNBC's "Capital Connection."
Still, some experts have said Modi's "strongman" image could give him room to ease tensions with Pakistan without alienating his base when the captured pilot is returned safely.
— Reuters contributed to this report.