This article originally appeared in Foreign Policy.

No country aside from Afghanistan has more to lose than Pakistan from the coming departure of international forces. All post-2014 scenarios seem dark for Pakistan should the challenged Afghan state begin to unravel. In a protracted civil war, a reluctant Pakistan stands a good chance of being drawn into the conflict along with other regional powers. Taliban gains leading to a radical Islamic regime in all or most of Afghanistan, while once welcomed by Pakistan, may now result in empowering Pakistan's own militant extremists. Intensified fighting across the border is certain to push millions of new refugees into a Pakistan unprepared and unwilling to absorb them. Prospects that a successfully negotiated political agreement might some time soon avert these outcomes seem dim.

And yet, Pakistan does have one policy option that can result in a brighter scenario for itself and its Afghan neighbor. This opportunity has, in fact, been available throughout the course of the last 12 years, but it requires a strategic reassessment by Pakistan of its long-term national security interests, recognizing that they are best served when there is a stable, peaceful, prospering and, yes, independent Afghanistan. While Pakistan officially endorses this vision, its policies regularly undermine its achievement, above all by giving sanctuary and sustenance to Afghan insurgents. Instead, Pakistan should fully embrace efforts that improve prospects for the emergence of a moderate, economically improving, and accountably-governed Afghanistan. As University of Peshawar professor Ijza Khan advises, rather than pursuing a strategy focused on ensuring a friendly regime in Kabul, Pakistan should strive to win the friendship of the Afghan state and its people.

Convincing Afghans of Pakistan's good intentions will not be easy. Almost regardless of their political disposition, Afghans view their neighbor as overbearing and covetous, blaming it for much of the country's problems. Building trust is bound to be a slow process. Yet Pakistan is not without the means with which to allay Afghan suspicions. An economically-strapped Pakistani government cannot offer the kind of financial assistance that the West and Japan provide Afghanistan, or even match India's development aid portfolio. But Pakistan has advantages that come with geographical proximity, overlapping cultural and ethnic affinities, and established economic ties. It also has a relative abundance of human capital available with which to help strengthen the Afghan state.

To begin, Pakistan could agree to open the long denied trans-country routes that block India's trade with Afghanistan. Afghanistan's critical dependence on road links to the port of Karachi could be better secured and border impediments removed. Existing training programs in Pakistan for Afghan civil servants could be greatly expanded. Pakistan can do more to allay Afghans' beliefs that it is obstructing a peace deal with the Taliban and assure them that it has no plans to divide Afghan territory ethnically. Pakistan can also help secure Afghan presidential and parliamentary elections scheduled in 2014 and 2015, respectively, by using its not inconsiderable influence to limit Taliban interference. It could also place additional troops at the border to reduce infiltration, much as it did during elections in 2004 and 2005. Although largely symbolic, Pakistan might even propose a non-aggression pact. But all these trust-building actions would pale against a decision by Pakistan to withdraw its patronage of the Afghan Taliban. Simply put, it must be willing to evict, if not arrest, Afghan Taliban fighters and their leaders on its soil.

Admittedly this will be hard. It will incur risks for Pakistan, particularly inviting a backlash not just from Afghan Taliban in the country, but also from their Pakistani allies. Afghans may be driven into open alliance with Pakistani insurgents and other extremist groups against the state. Yet this is a fight that Pakistan must eventually undertake. It cannot continue trying to differentiate between good and bad militants and expect the country's endemic violence to end. Delay has only made the task more difficult. If there is to be a reckoning, Pakistan may find that dismantling the Afghan Taliban offers a less difficult first step toward eliminating all of the militant groups that are currently or will inevitably be challenging the Pakistani state.

Pakistan has much to gain from a strategic reappraisal. Aside from possibly avoiding an Afghan civil war and its consequences, Pakistan could expect to enlist Afghan efforts to deny Pakistan's Taliban insurgents the safe haven they have found across the border. Pakistan could feel confident that the Baloch rebellion is not being fueled from the Afghan side of the border and that India does not overplay its hand once NATO forces leave. More broadly, Pakistan should have less reason to fear India's role in Afghanistan. A stabilized, secure Afghanistan would find it unnecessary to look to India to provide a counterweight to Pakistan or worry Pakistan by maintaining an oversized army.

Building confidence between the two countries could also perhaps permanently defuse their long-standing dispute over the Durand Line that separates them. With improved security in Afghanistan, new life could be breathed into plans to construct a gas pipeline from the fields in Turkmenistan. A growing Afghan economy would open up new markets for Pakistani goods and services and improve opportunities for investment. And Pakistan's dreams of using Afghanistan as a road bridge to Central Asia to extend its commerce and political influence might finally become a reality.

Without reciprocating Afghan policies, friendly overtures by Pakistan cannot be sustained. But it is Pakistan's initiatives that will drive any embrace. More than any external power, its actions will determine whether the present Afghan state can succeed against the current odds. And through assisting its struggling neighbor, Pakistan may help secure its own future.

The Middle East Institute (MEI) is an independent, non-partisan, non-for-profit, educational organization. It does not engage in advocacy and its scholars’ opinions are their own. MEI welcomes financial donations, but retains sole editorial control over its work and its publications reflect only the authors’ views. For a listing of MEI donors, please click here.