KABUL, Afghanistan (AP) -- Afghanistan's two rival candidates reached a breakthrough agreement Saturday to a complete audit of their contested presidential election and, whoever the victor, a national unity government.
The deal, brokered by U.S. Secretary of State John Kerry, offers a path out of what threatened to be a debilitating political crisis for Afghanistan, with both candidates claiming victory and talking of setting up competing governments.
Such a scenario could have dangerously split the fragile country's government and security forces at a time the U.S. is pulling out most of its troops and the Taliban continues to wage a fierce insurgency.
Instead, former Finance Minister Ashraf Ghani and former Foreign Minister Abdullah Abdullah consented to abide by a 100 percent, internationally supervised audit of all eight million ballots in the presidential election and a national unity government once the results are announced.
But Kerry, who brokered the breakthrough after two days of negotiations, warned early today that much work still remained. "This will be still a difficult road because there are important obligations required and difficult decisions to be made," Kerry said.
The audit is expected to take a "number of weeks" and would begin with the ballot boxes in Kabul. Ballot boxes from the provinces are to flown to the capital by helicopter by U.S. and international forces and examined on rolling basis. Representatives from each campaign as well as international observers will help oversee the review, and the candidate with the most votes would be declared the winner and become president.
Both candidates agreed to respect the result, and the winner would immediately form a national unity government. The inauguration, which had been scheduled for Aug. 2, would be postponed.
Abdullah, who spoke first at the news conference announcing the breakthrough, said the election created "serious challenges."
But he praised Ghani for ideas on how the audit would be conducted and the framework for a unity government would be established once the victor is determined.
Ghani returned the compliments to Abdullah, lauding his competitor's patriotism and commitment to a dialogue that promotes national unity.
"Stability is the desire of everyone," Ghani said. "Our aim is simple: We've committed to the most thorough audit" in history. Such a process would remove any ambiguity about the result, he added.
Abdullah and Ghani spoke first in English, then in Dari. Ghani also spoke in Pashto.
Ghani noted Afghan President Hamid Karzai reluctantly agreed to stay on as president until the new government formed for the good of the country.
The announcement came as a relief to a country on edge and worried about how the election dispute would resolve itself. Both the full audit and the agreement to form a unity government drew praise from television commentators immediately after the speeches.
The prolonged uncertainty about the outcome of the election has jeopardized a central plank of President Barack Obama's strategy to leave behind a stable state after the withdrawal of most U.S. troops at year's end.
Preliminary runoff results, released earlier this week against U.S. wishes, suggested a massive turnaround in favor of the onetime World Bank economist Ghani, who lagged significantly behind Abdullah in first-round voting.
Abdullah, a top leader of the Northern Alliance that battled the Taliban before the U.S.-led invasion in 2001, claimed massive ballot-stuffing. He was runner-up to Karzai in a fraud-riddled 2009 presidential vote before he pulled out of that runoff, and many of his supporters see him being cheated for a second time. Some, powerful warlords included, have spoken of establishing a "parallel government."
Kerry met for the second day with Ghani and Abdullah after discussions Friday proved inconclusive, even though both candidates have acknowledged fraud in the election and agreed in principle to a UN investigation. He also met with Karzai and the UN chief in Afghanistan, Jan Kubis.
Kerry and Karzai discussed the deal past midnight Saturday. When they emerged early today, the Afghan leader endorsed the outcome. Speaking alongside Karzai at the Presidential Palace, Kerry said the democracy springing up in Afghanistan "deserved its full bloom."
He said difficult actions were still required, but hailed the two candidates for coming together in the interest of country.
"We hope that the promise of the next weeks will deliver the authenticity and credibility that the people of Afghanistan deserve," Kerry said. He offered robust U.S. support to ensure the deal holds.