Traditionally strong ties between Afghanistan and Pakistan have been strained in recent months by almost daily border incursions. Afghan officials accuse Pakistan of failing to crack down on militants from the ousted Taleban regime, who use Pakistani territory to launch attacks on Afghan police and soldiers, as well as on U.S.-led coalition forces.
But both governments fearing a growing conflict that neither can afford, are now trying to defuse the tensions, with some help from the United States.
The past few months have seen mistrust between Pakistan and Afghanistan reach its highest point in decades. The year-old Kabul government blames the Pakistanis for not doing enough to weed out insurgents loyal to Afghanistan's former strict Islamic Taleban regime. The insurgents apparently hide in Pakistan and use it as a staging ground for attacks on Afghanistan.
Assaults by Taleban militants, along with their allies from the al-Qaida terror network and the forces of renegade Afghan warlord Gulbuddin Hekmatyar, have cost hundreds of lives in Afghanistan over the past year.
Officials in Kabul are worried Pakistan's past warm ties with the Taleban have compromised its commitment to the U.S.-led anti-terrorism campaign. The campaign ousted the Taleban in 2001 and U.S. troops are still hunting al-Qaida forces in the country.
The top Pakistan military spokesman, Major General Shaukat Sultan Khan, denies his nation allows the insurgents into its territory or encourages violence.
"There are very rugged mountains and very deep ravines, and some undetected movement may take place. It can't be ruled out," he said. "But certainly all efforts are being made to ensure that no such movement takes place."
Islamabad has complaints of its own, alleging that Kabul is letting Pakistan's archrival India use Afghan territory as a base of operations.
Pakistani officials have said that Indian diplomatic posts in Afghanistan are fueling extremist violence in Pakistan and trying to disrupt relations between Kabul and Islamabad.
India denies the charges, and Afghan Interior Minister Ali Jalali says violence in Pakistan has nothing to do with India's representation in Afghanistan.
"The cause is extremism, mostly, and that was there even before the Indian Embassy was in Kabul," he said. "It took place in Pakistan and also it took place in Afghanistan. Let's call a spade a spade."
Vikram Parekh is an Afghanistan analyst for the Brussels-based International Crisis Group. While he sees nothing to substantiate claims of Indian mischief in Afghanistan, he can understand Pakistan's concern.
"India's establishment of diplomatic missions in Jalalabad and Kandahar are undoubtedly provocative to the Pakistanis, and probably it's fair to believe they were designed to be so," he said.
The mutual suspicions have raised tensions to a dangerous level.
Sentiment boiled over in Kabul last month, when angry Afghan protestors ransacked Pakistan's Embassy, forcing diplomats to rush for cover in the basement.
Moreover, armed skirmishes regularly erupt across the border, as each side guards against what is sees as hostile elements crossing its frontier.
Though both governments play down such incidents as "misunderstandings," the fear that these skirmishes could permanently damage relations is very real.
In fact, both countries need each other's friendship.
Pakistan, always wary of India on its eastern flank, cannot afford to be boxed in by a hostile Afghanistan to the west.
The Afghans, despite Pakistan's former ties to the Taleban, fear what could happen if Islamabad sought to destabilize their fledgling democracy.
As a result, the two nations are now working overtime to defuse the situation.
Officials from both sides have embarked on a flurry of visits, including one by Afghan President Hamid Karzai.
During his recent trip to Islamabad, Mr. Karzai underscored the importance of strong bilateral ties.
"There is only one way for the two countries and that is of brotherhood and of trade and of good relations and of respect," he said.
For his part, Pakistan's President Pervez Musharraf has stressed Afghan insurgents will not be tolerated on Pakistani soil. He also calls for sharing more intelligence with Afghanistan to track down Taleban and al-Qaida forces.
The United States also is pushing for better ties between the two countries, both of which Washington sees as vital allies in its war on terror.
The United States has set up a commission of U.S., Afghan and Pakistani officials to help resolve shared concerns.
The commission has already acted to set up hotlines between the U.S., Pakistan and Afghanistan militaries to better coordinate security along the border.
Some observers, such as Mr. Parekh, feel that divisive issues are trumped by the long-term need in the region for cordial Afghan-Pakistani relations.
"They share a long border between them, it's in fact Afghanistan's longest border, and it's an important trade conduit, not only for Afghanistan but also for India, in order to export its manufactured goods via Pakistan to Afghanistan," he said.
Mr. Parekh says improving relations in the face of concerns such as the Taleban and Indian diplomacy is a challenge both governments need to face.