Secretary of State Condoleezza Rice has vowed the US will not abandon its fight against militants in Afghanistan.
Ms Rice wants Afghanistan and Pakistan to co-operate more
Speaking in Kabul after talks with President Hamid Karzai, Ms Rice said the US, Afghanistan and Pakistan would defeat "ruthless, determined enemies".
The visit comes amid mounting security concerns, with a rise in recent attacks blamed on the Taleban and al-Qaeda.
Last week, Mr Karzai criticised Nato and US-led operations in Afghanistan, deploring the deaths of Afghans.
The remarks highlighted strains with Washington over the coalition's efforts to confront the Taleban and other insurgents.
There is also a climate of deep mistrust and suspicion between Afghanistan and Pakistan, two key allies in the "war on terror", the BBC's Bilal Sarway in Kabul says.
Meanwhile, two suspected suicide bombers have died in a blast near a US-led coalition convoy in the southern Afghan province of Zabul, police say. No one else was hurt.
There were also more clashes overnight between suspected Taleban fighters and British troops in Helmand province, a day after two British soldiers were killed there.
The past month has been one of the bloodiest in Afghanistan since the US-led invasion in 2001.
Ms Rice acknowledged the increase in violence was a concern but said "democratic gains" would not be wiped out.
"The commitment of Pakistan, of Afghanistan, of the United States, indeed of the international community, against this enemy is going to succeed.
"We are not going to tire. We are not going to leave," she told a joint news conference, shortly before leaving the country.
Mr Karzai said "terrorism" was losing the fight in his country.
"They will try to hurt us but the success is moving further and further and that is the story in Afghanistan," he said.
Foreign soldiers have been targeted by the Taleban and their allies
Neither leader referred to comments last week in which he described as unacceptable the deaths of many Afghans in recent fighting and called for more focus on the root causes of violence.
There have also been disagreements over the president's proposal to arm Afghans in remote villages as a way of improving security.
Correspondents say that suggestion has raised US questions about Mr Karzai's leadership.
The United Nations has also expressed concern that efforts to stamp out opium production in the country are being hampered by persistent lawlessness - an issue that still has not been resolved.
Ms Rice travelled to Afghanistan from Pakistan, where she described the neighbours as friends of the United States and "fierce fighters in the war on terror".
But she urged Pakistan's President Pervez Musharraf to co-operate more closely with Afghanistan against the Taleban.
A spokesman for Mr Musharraf insisted Pakistan was playing its part.
In recent months Kabul has often blamed Islamabad for the upsurge in Taleban-related attacks in Afghanistan.
Pakistan denies it is doing too little to prevent attacks launched from its territory.