The fall of Afghanistan's Taleban government in 2001 reshaped the geopolitical map for South and Central Asia. Among the nations most affected has been Pakistan, which has deep economic and strategic interests in its western neighbor. In this second part in a series on foreign influence in Afghanistan, VOA's Michael Kitchen looks at how Pakistan is trying to revive its once-strong relations with Kabul.

While the Taleban ruled Afghanistan, it depended on the Pakistanis as a link to the outside world.

For Pakistan, war with India has long been a threat, and it needed close relations with the Afghans to maintain a safe western flank, a doctrine called "strategic depth."

But three years ago, the United States joined forces with Afghan opposition groups to oust the Taleban, which had refused to hand over al-Qaida leader Osama bin Laden.

Since then, Pakistan has had to rebuild relations with Kabul, working with the new government of President Hamid Karzai.

Former Pakistani General Talat Masood says ties have improved in part because of Pakistan's willingness to help hunt down remnants of its former Taleban ally, who are waging an armed insurgency against the new Afghan government. Many are believed to be hiding in Pakistan's tribal areas near the Afghan border.

"Because of Pakistan's support to the war on terror and its military activities in the tribal belt, and [because] Pakistan changed its policy and started fully supporting the Karzai government, I think since then, the relationship has been on the mend," he said.

The strategy seems to be paying off, as President Karzai has gone from criticizing Pakistan to praising it.

"What Pakistan has done so far in the tribal territories of Pakistan is something we appreciate, we welcome," he said.

Islamabad also is trying to win over its Afghan neighbors with aid, and has committed over $100 million.

Yet, Pakistan knows the days of "strategic depth" against India are over.

While the Indians were largely excluded from relations with the Taleban government, they are competing for influence in the new Afghanistan.

Pakistani officials have voiced concern about India's new diplomatic missions in cities just inside Afghanistan.

They worry this Indian presence could be used to spy on their country, and that close Indo-Afghan ties would leave Pakistan boxed in.

Pakistani Foreign Ministry spokesman Masood Khan says a dialogue is under way to make sure that India's presence in Afghanistan is benevolent.

"We are watching the situation very closely. We have conveyed our concerns, that there shouldn't be any anti-Pakistan activity along the Pakistan-Afghanistan border. And I think there is appreciation of this point of view," he said.

Fortunately for Islamabad, India's growing influence in Afghanistan coincides with the flowering of Indo-Pakistani peace talks.

General Masood says the peace process is easing Pakistani tensions over goings on in Afghanistan.

"If our relations with India improve, I'm sure our relations with Afghanistan will also improve. And I think this also one of the reasons why there has been an improvement in our relations," the general said.

But Pakistan has other reasons for its interest in Afghanistan. By one estimate, Afghanistan bought a quarter of its imports from Pakistan last year. Some Pakistanis hope trade will increase as the Afghans recovers from two decades of war.

Of even greater interest to Pakistan is a proposal to build a gas and oil pipeline linking it to the resource-rich nations of Central Asia.

But as General Masood explains, these economic interests bring Pakistan into conflict with another regional power: Iran.

"There is a rivalry with Iran. There has always been, because both compete for influence in Afghanistan, and both are wanting to get energy pipelines through their country," he said.

Iran also provides tough competition for Pakistan in the growing Afghan market.

Pakistan Foreign Ministry's Mr. Khan says Islamabad is being very careful to keep these vying interests from getting out of hand.

"I think that instead of competition for exclusion, we should have competition for cooperation," he said.

Despite diplomatic goodwill, analysts say competition is likely to remain tough among all foreign interests, now that the rigid alliances of the Taleban era have fallen to a wide-open new Afghanistan.