KABUL (AFP) - US Secretary of State John Kerry vowed in Kabul to stick by Afghanistan as President Hamid Karzai, after a series of fiery outbursts, hailed a "good day" for ties with the handover of a military jail.
Mr Kerry came to Afghanistan on an unannounced visit just after the United States, acceding to a long-standing demand of Mr Karzai, delivered full control of the prison at Bagram to Afghan forces.
Mr Karzai had turned the fate of Bagram and its hundreds of detainees into a rallying cry for his ill-tempered push to grab back sovereignty from the Americans, as US-led combat troops wind down more than a decade of war.
Both the Afghan leader and Mr Kerry appeared keen to move on.
"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," Mr Karzai told reporters.
Mr 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 Taleban shake this commitment."
Earlier this month, the Afghan president accused the US of working in concert with the Taleban 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, Mr Kerry said he was confident Mr Karzai "absolutely does not believe that the United States has any interest except to see the Taleban come to the table to make peace".
For his part, Mr Karzai said: "I was interpreted as saying the US and Taleban are colluding, but I did not use this word."
Afghan troops and police are gradually taking on responsibility for battling the Taleban as most of the 100,000 foreign troops prepare to exit by the end of 2014.
Australia on Tuesday said it was withdrawing the bulk of its 1,550 troops this year, with the closure of their main base in Uruzgan province.
"We've been there for over a decade, and that's far too long," Defence Minister Stephen Smith said, adding that the war was "the easiest thing in the world to get in, hardest thing in the world to get out".
Mr Karzai is due to step down at elections next year, 13 years after he came to power with US backing when the hardline Taleban 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.
Mr Karzai said he plans to visit Qatar shortly, with US backing, to discuss the proposed opening of a Taleban office in the Gulf emirate as a prelude to possible peace talks.
"Those who come on behalf of the Taleban can talk and they have the right to talk to all Afghans," he said.
However, the Taleban refuse to communicate directly with Mr Karzai, whom they view as a puppet of the United States.
"The Taleban will hopefully understand that peace and peace talks are the best way to resolve differences," Mr Kerry said.
The long war is increasingly unpopular in the United States, and the latest outbursts from Karzai had 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.
But Mr Karzai appeared keen to repair damaged ties with his acclamation of the handover of Bagram, a sprawling detention centre north of Kabul.
The United States was long concerned that a total handover to Afghanistan's weak and corruption-prone security forces would allow suspected Taliban and Al-Qaeda militants housed at Bagram 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 from the Middle East.