Afghan President Hamid Karzai on Monday gave a lukewarm response to Pakistan's invitation to visit Islamabad, setting conditions for any high-level talks designed to mend increasingly frosty relations.
Pakistan on Sunday sent its top diplomat to offer further assistance to Afghanistan's efforts to reach a deal with Taliban insurgents to end 12 years of war.
Foreign affairs adviser Sartaj Aziz held talks with Afghan Foreign Minister Zalmai Rassoul and met Karzai to deliver in person the invitation from new Pakistani Prime Minister Nawaz Sharif -- already extended twice by telephone.
On Monday the president's office said Karzai accepted the invitation "in principle".
But he said a high-ranking delegation could visit Pakistan only when the agenda is specified, initial preparations have been made and a "serious and effective struggle against terrorism and the peace process are on the top of the agenda".
The West considers Pakistan's support vital to achieving lasting peace in Afghanistan. But relations between the neighbours are mired in mutual distrust and accusations over Taliban and other Islamist militancy which plagues both countries.
Aziz is the most senior member of Pakistan's new government to visit Afghanistan at a time when relations between Kabul and Islamabad have been worsening.
International efforts to start talks with the Taliban are in disarray after the disastrous opening of a liaison office for the insurgents in Qatar. A furious Karzai slammed it as an unofficial embassy for a Taliban government-in-exile.
Last week Karzai's chief of staff, Karim Khorram, claimed the Taliban office was part of a plot to break up Afghanistan, orchestrated by either Pakistan or the United States.
Aziz denied perceptions held by many in Afghanistan that Pakistan controls the Taliban, saying only that "we have some contacts" with the militia.
The scheduled departure next year of around 100,000 US-led foreign troops and Afghan presidential elections in April have lent renewed urgency to the quest for peace.