Over the last two decades India has failed time and time again to deter two of its biggest opponents in the region, China and Pakistan.

India’s military is not yet adequate to deter China, and they are desperately trying to address this failure by developing and improving their military capabilities. There is not much more to say about India’s deterrence challenge in regards to China.

A more complex and perplexing challenge it has been trying to figure out is how to successfully deter Pakistan.

In terms of Pakistan it is not a matter of sufficient military capability but more of a doctrinal challenge. Despite their nuclear and conventional superiority, India has failed to deter Pakistan, and the miserable state of affairs between the two countries has been pretty much the same since they both overtly declared themselves nuclear weapon states in 1998.

The evidence of India’s doctrinal failure towards Pakistan has been seen in the dozens of military conflicts both countries have engaged in over the past two decades. The problem it seems is that India has been trying to find a military solution to the Pakistani puzzle.

It now looks as if India might finally abandon its belligerent military doctrine towards Pakistan for a new doctrine of engagement. Last week at the 7th BRICS summit in Russia, Narendra Modi, India’s Prime Minister accepted an invitation by his counterpart, Prime Minister Nawaz Sharif to visit Pakistan in 2016.

This will be a first ever visit to Pakistan by an Indian Prime Minister in over a decade.

This is a welcome break from the outdated Cold War-era mentality and could be due to the fact that the current Pakistani government has been trying very hard to engage India in dialogue or perhaps, Prime Minister Modi saw the positive impact of American President, Barack Obama’s doctrine of engagement in regards to Iran and Cuba. It is an encouraging development, whatever the case may be.

The task now will be to make sure that the planned trip is not sabotaged by hardliners in India or Pakistan. It has only been a week since the announcement of the trip by the foreign secretaries of both countries, and already Pakistan and India find themselves locked in a heated gunfight across the Line of Control (LOC), which has already claimed civilian lives on both sides.

The latest firing started after Pakistan shot down a commercially available spy drone as it crossed into Pakistani airspace from India. The Indian government has officially denied ownership of the drone. But the Inter-Services Public Relations (ISPR) directorate of the Pakistan military has released footage, linking the drone to the Indian military. This is likely to further aggravate the already sour relations.

The shooting down of the drone by Pakistani forces resulted in a gun battle on the LOC. Both Pakistani and Indian leaderships have an opportunity to prove their genuine desire for peace by showing restraint. If Prime Minister Modi’s visit is derailed by the ongoing conflict on the LOC, both countries will once again find themselves trapped in a spiraling circle of conflict, which is not a good thing for either side.

If history has proven anything for both Pakistan and India, it is that fighting does not resolve anything. It should be abundantly clear to both sides by now that threats have failed as a deterrent, and the only way forward now is through constructive dialogue.

There will of course be outstanding disputes between the two countries. Not to mention the fact that as India continues to grow its military power in an effort to counter China and become a great regional power, they will inadvertently create a security dilemma for Pakistan. And without good diplomatic relations this creates an atmosphere of insecurity.

It has not helped that both countries have never had normal ties. If India is able to successfully deter Pakistan through engagement it will benefit both countries greatly. It could put an end to the existing arms competition between the two countries and provide huge economic opportunities to both sides.

In addition, through dialogue Pakistan and India can tackle the threat of regional terrorism by sharing information and intelligence. You never know after years of failing to resolve the Kashmir dispute through force, both sides might possibly find a solution that they can live with through peaceful dialogue. It will not hurt to try. If India is too immature to take a step towards peace, then it is Pakistan’s responsibility as a mature nuclear power to do so.

It is only through diplomacy and increased economic interdependency that both Pakistan and India can prosper in the future. Hopefully both countries have come to this realization by now. They must keep their eyes on the prize and not let anything distract them from securing permanent peace.