KABUL - 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.

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".

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. Meanwhile, the Afghan president told the top US military commander that he was ready in principle to let American troops stay in Afghanistan beyond 2014, a month after suspending security talks.

General Martin Dempsey, the chairman of the joint chiefs of staff, is the most senior American to meet Hamid Karzai since he suspended negotiations for a long-term security pact in protest at how the Taliban opened a liaison office in Qatar.

Karzai's office said both sides discussed the Afghan-US security pact.

"President Karzai once again emphasised that the Afghan people have suffered from long years of war in their country, and want peace to be restored," a statement said.

"President Karzai said with that hope, Afghans are ready to sign a security pact with the US, on condition that it leads to peace and stability in the country, the strengthening of Afghan forces, and a united and sovereign Afghanistan," it added.

Karzai suspended the security talks, furious that the Taliban styled their office in Doha as an embassy for a self-styled government in waiting.

Special Correspondent In Washington adds: The United States Monday underscored Pakistan's role in Afghan reconciliation even as Afghan officials voiced skepticism.

State Department Spokesperson, Jen Psaki, when asked to comment on the weekend visit by Sartaj Aziz, said Washington viewed any steps contributing to building Pakistan-Afghanistan relations as “very important,” “Pakistan is an important partner in supporting a secure and stable Afghanistan, which is vital to the security of the region,” she said at a press briefing.

The spokesperson also noted that “Pakistan’s own security and stability is tied with successful outcome in Afghanistan,” where the US is looking to conclude its combat role by the end of 2014.