Afghan President Ashraf Ghani’s initiative to improve relations and build trust with Pakistan has compromised his country's relations with its traditional ally, India.
But Pakistan's failure in delivering the Afghan Taliban to a lasting peace settlement will likely force Ghani to look toward New Delhi as its main regional ally.
The decades-long rivalry between India and Pakistan is partly responsible for instability in Afghanistan.
India's influence in Afghanistan has remained Pakistan's greatest fear and was the reason Islamabad embraced the Taliban after their regime collapsed in late 2001. Islamabad has recently blamed India’s foreign intelligence service, Research and Analysis Wing (RAW), for insecurity in Pakistan.
Earlier this year, former Pakistani military dictator Pervez Musharraf said one of the reasons for his country to undermine the Afghan government was that former President Hamid Karzai "helped India stab Pakistan in the back." Musharraf criticized Karzai for fostering a close alliance with India during his 13-year term.
To earn Pakistan's trust, however, Ghani has geared his foreign policy toward Pakistan and undertaken some bold steps. Despite domestic criticism, he withheld an arms deal with India that Karzai had concluded. For the first time, Ghani sent Afghan Army cadets to train in Pakistan and even allowed the Pakistani military to conduct joint operations in Afghanistan and interrogate Pakistani Taliban members in Afghan government custody.
President Ghani's pivot to Pakistan has chiefly been because of its potential key role in bringing Afghan Taliban to peace talks and its importance for economic integration in the region.
However, Pakistan has been slow to reciprocate Ghani's positive overtures.
The Afghan Taliban launched their deadly spring offensive "Azm" and there has been no progress in addressing the problems that exist in overland trade between Afghanistan and India through Pakistan. Islamabad is still reluctant to open a road link between Kabul and New Delhi. In addition, Pakistan has continued to harass and forcefully repatriate Afghan refugees.
Still, Ghani has not given up. He wants to give Islamabad more time to fulfill its promises and senses the ongoing conflict in his country has security implications for Pakistan. During his Kabul visit this month, Pakistani Prime Minister Nawaz Sharif denounced Taliban violence and said "the enemies of Afghanistan cannot be friends of Pakistan."
Pakistan has more reasons to deliver on its promises. Its alliance with the Afghan Taliban appears to be in shambles. It seems that Islamabad now shelters Afghan Taliban leaders out of fears the group may turn against them, as well.
A senior Taliban figure recently told me that earlier this year Pakistani military handlers had asked the Afghan Taliban to agree to a peace settlement with Kabul or leave their country.
The Taliban, the source claimed, decided to leave, which prompted Islamabad to tone down its demands and urged the Taliban to continue operating out of Pakistan but also engage in meetings with Afghan officials. This resulted in a "nonofficial" meeting in Doha, and it is worth remembering that the Taliban have participated in similar meetings in the past.
In another bold step to cement ties with Pakistan, Afghanistan's security service, the National Directorate of Security (NDS), signed a Memorandum of Understanding (MoU) with Pakistan’s Inter-Service Intelligence (ISI) this week. The two agreed to share intelligence and jointly fight against terrorism in their shared border region.
This signing provoked a negative public response. Former President Hamid Karzai, his two intelligence chiefs Assadullah Khalid and Amruallha Saleh, lawmakers, and senior government officials have criticized the intelligence-sharing deal with Pakistan.
Hasht-e-Subh, a Kabul daily, reported that NDS chief Rahmatullah Nabil refused to sign the deal, leaving the task to his deputy. Senior NDS officials in southern and southeastern provinces along Pakistan's border are also skeptical of the agreement.
Officials say the deal would allow ISI to further interfere in NDS affairs and that the consequences would be "dire." One NDS official told me that "this deal and joint military operations [between Kabul and Islamabad] will only benefit Pakistan, and our resources will be exploited for stability in Pakistan."
To prove its commitment to stability in Afghanistan and the region, Pakistan must move decisively against the Afghan Taliban. It must even consider a military operation against Afghan Taliban leadership reportedly hiding in southwestern Balochistan Province.
The Afghan Taliban will surely consider quitting fighting when their safe havens and training camps across the border in Pakistan are seriously threatened.
Islamabad must capitalize on this opportunity and end the menace of terrorism and militancy in the region, which has already harmed Pakistan more than it has India.
Moreover, by facilitating Indo-Afghan trade, Islamabad would further strengthen relations with Kabul and even open a window for improving ties with India. In the near future, Kabul can reciprocate by connecting Islamabad and the rest of South Asia with energy-rich Central Asia.
But Pakistan's failure to honor its word could frustrate Ghani and take things back to square one. He could be forced to follow his predecessor's footprints and turn to India instead.
Hekmatullah Azamy is a research analyst with the Centre for Conflict and Peace Studies in Kabul, Afghanistan. These views are the author's alone and do not represent those of Radio Free Europe/Radio Liberty.