US Secretary of State John Kerry held a second round of talks with Afghan President Hamid Karzai in Kabul on Tuesday after the two put on a public show of unity in a bid to repair damaged ties.
Kerry visited Afghanistan just after the United States ceded to a key long-standing demand of Karzai by delivering full control of Bagram prison, north of Kabul, to Afghan forces.
Karzai had turned the fate of Bagram and its hundreds of detainees into a rallying cry for his push to take back sovereignty as the bulk of US-led combat troops prepare to leave by the end of next year after more than a decade of war.
The militant threat facing Afghanistan was on Tuesday again underlined when seven suicide bombers targeted a police base in the eastern city of Jalalabad.
All the attackers and five officers died in the assault, for which the Taliban claimed responsibility.
After a series of fiery anti-US outbursts from Karzai in recent weeks, both he and Kerry were keen to make a public display of friendship and stress that relations were back on track.
"Today was a good day for Afghanistan. Bagram prison was handed over to the Afghan government... Finally after many years of effort we have reached a deal," Karzai told reporters at a joint press conference late Monday.
Kerry said: "The US is committed to an enduring partnership... The US supports a strong and united Afghanistan.
"We are committed to Afghanistan's sovereignty and we will not let Al-Qaeda or the Taliban shake this commitment."
Earlier this month, the Afghan president accused Washington of working in concert with the Taliban and his spokesman described the coalition's war effort as "aimless and unwise", triggering fury from Afghanistan's foreign backers.
Responding to a storm of protest over the collusion allegations, Kerry said he was confident that Karzai "does not believe that the United States has any interest except to see the Taliban come to the table to make peace".
For his part, Karzai said: "I was interpreted as saying the US and Taliban are colluding, but I did not use this word."
Afghan troops and police are gradually taking on responsibility for battling the Taliban as most of the 100,000 foreign troops prepare to exit by the end of 2014.
Australia Tuesday said it was withdrawing the bulk of its 1,550 troops this year, with the closure of their main base in Uruzgan province. Defence Minister Stephen Smith praised security improvements, and said the time was right.
"We've been there for over a decade, and that's far too long," he said, adding that the war was "the easiest thing in the world to get in, hardest thing in the world to get out".
Karzai is due to step down at elections next year, 13 years after he came to power with US backing when the hardline Taliban regime was ousted in the aftermath of the September 11 attacks of 2001.
The military and political calendars are lending added urgency to the search for a negotiated settlement to resolve Afghanistan's decades of conflict.
Karzai said he plans to visit Qatar shortly, with US backing, to discuss the proposed opening of a Taliban office in the Gulf emirate as a prelude to possible peace talks.
The Taliban, however, refuse to communicate directly with Karzai, whom they view as a puppet of the United States.
The war is increasingly unpopular in the United States, and the latest outbursts from Karzai led many US commentators to call for Washington to take a tougher stance towards Kabul.
The Afghan leader in past weeks has also demanded US special forces leave the flashpoint province of Wardak and banned international troops from university campuses, both due to unproven harassment claims.
Washington was concerned that the handover of Bagram to Afghan security forces would allow suspected Taliban and Al-Qaeda detainees to return to the battlefield.
But a final agreement was sealed on Saturday and a handover ceremony was held at the jail shortly before Kerry flew into Kabul.