KABUL - Afghanistan's presidential rivals signed a power-sharing deal on Sunday, ending a prolonged standoff over disputed election results at a pivotal moment in the war-weary nation's history.
Former finance minister Ashraf Ghani, who is set to become president when official results are released later in the day, embraced Abdullah Abdullah briefly at a low-key ceremony in the presidential palace that lasted less than 10 minutes.
The deal broke a three-month deadlock over allegations of massive electoral fraud that plunged Afghanistan into crisis as US-led troops end their 13-year war against the Taliban.
Both Ghani and former foreign minister Abdullah claimed to have won the vote, but Ghani is widely reported to have come out ahead after a UN-supervised audit of all eight million ballot papers.
Under Sunday's deal, Abdullah will nominate his choice for the new post of "chief executive officer" (CEO), which will be similar to prime minister - setting up a tricky balance of power as Afghanistan enters a new era.
"I'm happy that our brothers Dr Ashraf Ghani and Dr Abdullah struck an Afghani deal for the sake of goodness and prosperity of the country," outgoing President Hamid Karzai said in a short speech after the signing.
"I hope with their efforts this country gets long-lasting peace." Neither candidate spoke at the ceremony, and it remained uncertain when they would address the nation or when the agreement would be officially published.
Under the constitution the president wields almost total control, and the new government structure will face a major test as the security and economic outlook worsens.
The vote count has been plagued by setbacks amid allegations of massive fraud, emboldening the Taliban insurgents and further weakening the aid-dependent economy.
As tensions rose in Kabul, the United Nations and United States pushed hard for a "national unity government" to avoid a return to the ethnic divisions of the 1990s civil war.
Will the deal stick?
The ruling coalition between opposing camps is likely to be uneasy after a bitter election that revived some of the ethnic rivalries of the civil war, which ended with the Taliban taking power in Kabul in 1996.
Abdullah, a former anti-Taliban resistance fighter, draws his support from Tajiks and other northern ethnic groups. Ghani, an ex-World Bank economist, is backed by Pashtun tribes of the south and east.
"There will be two powers in the government, and it will be very difficult for them to work together," Sediq Mansoor Ansari, an analyst and director of the Civil Societies Federation, told AFP.
"I think the people of Afghanistan will wonder about their votes, and how their votes have been played with." The future of Afghanistan's relationship with the US-led NATO alliance will also be high on the agenda after Karzai refused to sign a security pact with Washington to ensure a foreign military presence after this year.
The White House welcomed Sunday's deal, which it said "helps bring closure to Afghanistan's political crisis".
"We look forward to... the conclusion of the Bilateral Security Agreement," it added in a statement.
According to a copy of the unity government document seen by AFP, the CEO could become the official "executive prime minister" in two years' time - a major change to the way Afghanistan has been ruled since 2001.
Abdullah may take up the CEO role, but is thought likely instead to nominate an ally.
Dividing up other official posts could also create friction after the long and mercurial reign of Karzai, who built up a nationwide network of patronage.
The UN's country director Jan Kubis welcomed the breakthrough, but warned that "for the sake of the country, it is time to quickly implement the agreement".
After the June run-off election was engulfed in fraud allegations, the US brokered a deal in which the two candidates agreed to abide by the outcome of the audit and then form a national unity government.
But Abdullah later abandoned the audit, saying it was failing to clean out fraud. He won April's first round, only to see Ghani come from well behind and win in June.
The new administration will have to stabilise the economy as international aid falls, and deal with worsening unrest.
About 41,000 NATO troops remain in Afghanistan, down from a peak of 150,000 in 2010, fighting alongside Afghan soldiers and police against the fierce Taliban insurgency.
NATO's combat mission will end in December, with a follow-on force of about 12,000 troops likely to stay into 2015 on training and support duties.