The two rival candidates in Afghanistan's presidential election have agreed to abide by the results of a UN-supervised recount of the entire poll to settle their dispute over the outcome, US Secretary of State John Kerry has said, after talks with both men.

The recount is to begin within 24 hours, and a presidential inauguration scheduled for August 2 will be postponed, Kerry said at a news conference on Saturday with the hand-holding candidates, Abdullah Abdullah and Ashraf Ghani.

"Both candidates have committed to participate in and abide by the results of the largest and most comprehensive audit; every single ballot that was cast will be audited," Kerry said.

"This is the strongest possible signal by both candidates of the desire to restore legitimacy to the process."

Kerry met both presidential candidates over the past two days in an effort to resolve a disputed election that threatens to stir ethnic tensions and undermine a peaceful political transition.

Al Jazeera's Jennifer Glasse, reporting from Kabul, said UN observers, UN and Afghan security forces and representatives from both parties would be involved in the process of collecting and recounting all eight million votes.

"There will also be a unity government, to make sure that every vote that was cast is counted, to make sure that the people who voted will be represented," she said.

Results seen as 'coup'

Afghanistan's election commission declared Ghani the winner of the second round of voting on June 14, with 56.44 percent of the vote, according to preliminary results.

The tally might change when the final official numbers are released on July 22.

Abdullah, who won the election's first round, rejected the second round results as a "coup" against the Afghan people, saying the result was invalid because it did not throw out all the fraudulent votes.

Presidential candidates Ashraf Ghani (left) and Abdullah Abdullah (right)

Abdullah is a former anti-Taliban fighter, and of Pashtun and Tajik heritage. Ghani has strong support from Pashtun tribes in the south and east.

Kerry has said that any effort to resolve the dispute through violence or any "extra-constitutional means," would cause the US to withdraw assistance from Afghanistan.

The secretary of state said Washington was not taking sides but instead was focused on creating a process that ensured Afghanistan's next leader was viewed as legitimate.

Kerry also met the incumbent president, Hamid Karzai, who is due to hand over power when an agreement is reached.

Violence continues to ravage the nation. On Saturday, at least 10 people were killed in separate roadside bombings in Kandahar province in the south and Nangarhar province in the east.

No group claimed responsibility for the attacks, but they come as the Taliban launched its spring offensive.

Source: Al Jazeera and agencies