KABUL: Afghanistan's feuding presidential candidates signed a deal Friday to form a national unity government, opening an apparent way forward in a dispute over the fraud-tainted election that threatens to revive ethnic conflict.
Ashraf Ghani and Abdullah Abdullah vowed to work together whoever becomes president after an ongoing audit of all eight million votes finally declares the winner of the June 14 election.
US Secretary of State John Kerry, visiting Kabul to mediate an end to the impasse, welcomed the deal as a major advance in bringing Afghanistan back from the brink of political chaos as US-led NATO troops withdraw.
But an earlier deal brokered by Kerry last month soon frayed due to disagreements between the candidates, and attention will focus on whether all their supporters accept the latest pact.
The risk of spiralling instability has loomed large in Afghanistan since Abdullah refused to accept preliminary results that put Ghani ahead, accusing his rival of stealing the election by massive ballot-box stuffing.
"Today (we) have taken another step forward in the interests of strengthening national unity... and also to bring hope for the better future for the people of Afghanistan," Abdullah said, standing beside Ghani and Kerry.
"We are committed to working together on the basis of our common vision for the future of our country."
The signed text admitted Afghanistan was "in one of the most politically sensitive periods of its history" due to the contested outcome of an election that should herald the country's first democratic transfer of power.
"We trust each other," Ghani said. "We will work with each other to fulfil this national duty and obligation for every Afghan.
"We are affirming that we will form a government of national unity... What unites us is far greater than what divided us during the campaign.
"He and I have reached an agreement and signed a communique for future cooperation."
The deal also said that both sides agreed that the successor to outgoing President Hamid Karzai should be inaugurated before the end of this month.
The timeline was a key demand of Kerry, who had stressed in talks with both candidates the importance of Afghanistan having a new president before a NATO summit in Britain on September 4-5.
The summit is scheduled to endorse a US-led NATO "training and advisory" mission in Afghanistan next year after all foreign combat troops withdraw by December.
But member nations have expressed reluctance to make costly commitments if Afghanistan fails to complete the election -- a key goal of the massive international military and aid effort since 2001.
"One of these men is going to be president, but both of these men are going to be critical to the future of Afghanistan, not matter what," Kerry said.
"This audit is not about winning or losing. It is about achieving a credible result that people of Afghanistan deserve."
Karzai, who has been president since the Taliban regime was ousted in 2001, has also called for an inauguration within weeks, saying uncertainty was damaging Afghanistan's fragile security and economy.
Taliban insurgents have launched new operations in the south and east in recent months, and violence is increasing across the country according to several independent reports.
US-led foreign troop numbers have declined from a peak of 150,000 in 2012 to just 44,300 now, and NATO combat operations are winding down fast after 13 years of fighting that have failed to defeat the Taliban.
Western nations that have sent troops and billions of dollars worth of aid to Afghanistan since 2001 still hope that a credible election will be a flagship legacy of progress made since the austere Taliban era.
The dangers of international military intervention were underlined this week when a rogue Afghan soldier shot dead a US general at an army training centre in Kabul, wounding more than a dozen others including a senior German officer.