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.
Afghan government forces have formally taken responsibility for security from US-led NATO troops due to leave the country next year. But there are concerns about their ability to stand against the Taliban unaided.
The New York Times reported this month that tense relations with Karzai might see Washington quicken its troop withdrawal or even leave no forces behind after 2014.
The Pentagon has said any potential longer-term US military presence would focus on targeting remnants of Al-Qaeda and, training and equipping Afghan forces.
The idea of a "zero option" of leaving no troops behind was mooted earlier this year by US deputy national security advisor Ben Rhodes.
The US relationship with Karzai, while never good and often volatile, deteriorated again over stillborn peace talks with the Taliban in Doha.
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.