Full cooperation between Islamabad and Washington is critical to U.S. efforts to stabilise Afghanistan before most NATO combat troops withdraw by 2014.
"There was a fairly difficult patch and I think we've moved away from that into a positive trajectory," Pakistani Foreign Minister Hina Rabbani Khar told Reuters in an interview, referring to Pakistani-U.S. relations.
"We are coming closer to developing what could be common positions. We wish to see a responsible transition in Afghanistan."
Relations between the uneasy allies were severely strained by a series of incidents in 2011. The crisis in ties began when a CIA contractor shot dead two men he suspected of trying to rob him in the city of Lahore.
Months later, U.S. special forces killed Osama bin Laden in a raid and kept the Pakistan military in the dark, humiliating the country's most powerful institution.
Then a NATO air raid mistakenly killed 24 Pakistani soldiers on the Afghan border in November that year.
In response, Pakistan expelled U.S. military trainers and CIA agents and placed limits on the numbers of visas given to U.S. diplomatic personnel.
Pakistan, which relies heavily on American aid, also closed supply routes for trucks carrying supplies to U.S.-led NATO forces in Afghanistan.
Now, Khar said, relations were fully repaired, including military and intelligence contacts.
"We are having very useful, deep conversations with the U.S.," she said, as the two countries try to find common ground on Afghanistan ahead of the scheduled 2014 pullout.
Both the United States and Afghanistan have long regarded Pakistan as an unreliable partner in the drive to bring stability to Afghanistan, accusing Pakistan's intelligence agency of backing Afghan insurgent groups.
Pakistan denies that.
Pakistan recently released mid-level Afghan Taliban prisoners to help facilitate peace talks between the militant group and the Kabul government, the clearest sign it was committed to advancing Afghan reconciliation.
Khar said Islamabad was willing to take further steps but would not say whether that would include releasing senior Afghan Taliban figures, like the former second in command, Mullah Abdul Ghani Baradar.
"I think it is important that we have intensive engagement on what needs to be done," she said.
Afghan officials think Baradar may be one of the few commanders with the stature to bring elements of the Taliban into peace talks after more than a decade of war.
During a recent visit to Pakistan by members of the Afghan High Peace Council, Pakistan agreed to release some prisoners, although not Baradar, and to provide safe passage for those wishing to enter talks, Khar said.
Pakistan would also encourage Afghan insurgents to enter into direct talks with President Hamid Karzai's government. So far, there have been only contacts.
"For us in Pakistan today, the most important capital in the world is Kabul," said Khar, because instability there could spill over into Pakistan, and fuel its own Taliban insurgency.
She said the Afghan and Pakistan governments were discussing ways to strengthen military cooperation.
Currently, relations are strained. Afghanistan still suspects elements in Pakistan of supporting the Taliban, despite denials from Islamabad. The Pakistan military, pursing Pakistani insurgents, has also shelled villages across the border in Afghanistan, prompting protests.
CLOSER TIES WITH INDIA
In addition to improving ties with Afghanistan, Khar said Pakistan also wanted to pursue closer ties with arch-rival India.
The United States has long believed that Pakistan would focus more closely on helping it pacify Afghanistan if relations with India improved.
The nuclear-armed neighbours have fought three wars since their independence from British rule in 1947 and are at loggerheads over the status of the disputed territory of Kashmir.
"The Pakistani leadership has shown a great willingness to move forward, sometimes at the cost of losing some political capital, because sometimes improving ties with India might not be the most popular thing to do," said Khar.
Many Pakistani politicians blame India for Pakistan's insurgencies or spiralling crime rate, saying their wealthier, more populous neighbour wants to weaken Pakistan.
India, in turn, blames Pakistan for sending militants to infiltrate Kashmir over several decades and suspects Pakistan of shielding those behind a 2008 attack on Mumbai that left 166 people dead. India executed the only surviving perpetrator in their custody, a young Pakistani man, last week.
That should be an opportunity for the two countries to put the attack behind them and move forward, said Khar.
Their warming relations recently resulted in an agreement easing trade and travel restrictions.
"We are clear that we want Pakistani-India relations to move forward swiftly," she said.