Kabul (CNN) -- An audit of Afghanistan's disputed presidential election results will begin within a day in Kabul, and the two candidates will accept its determination of who won, U.S. Secretary of State John Kerry said Saturday.
"Make no mistake. These will be the first steps of what will obviously be a hard, difficult process and we will be working hand in hand with both candidates," Kerry said. "In keeping with each of the candidate's request, this audit will be conducted with the highest international standards."
The inauguration of the new president, originally scheduled for the first week of August, will be postponed while the audit of votes cast for Abdullah Abdullah and Ashraf Ghani is conducted, Kerry said. Both candidates stood beside him.
Kerry announced the brokered deal amid fears the country could descend into chaotic bloodshed. He extended his stay here to deal with the issue.
Abdullah cited how "there were previous challenges in relation to the election, and today we are happy to announce" the agreement for an audit.
Ghani said he was "delighted" by the accord in which "the candidates will abide by the will of the people."
The two candidates clasped hands and raised them for the cameras before leaving.
Ballots cast in the provinces will be brought to Kabul by NATO-led International Security Assistance Force and Afghan national security forces for the audit, Kerry said.
Kerry arrived in Kabul on Thursday for the unannounced visit amid concern over signs of growing division following the country's contested presidential runoff election.
Despite efforts by the Taliban to disrupt the election, about 8 million votes were cast in June 14 balloting and provisional results showed Ghani ahead with roughly 56% support to 43% for Abdullah, according to Afghanistan's Independent Elections Commission.
Both candidates have alleged large-scale vote fraud and manipulation during the runoff last month.
The audit will take weeks to complete, Kerry said.
Amid continued insecurity, a civilian vehicle hit a roadside bomb in the Panjwai district of southern Kandahar province on Saturday, killing eight members of one family, including four women, according to the Afghan Interior Ministry. Two children were injured.
Only two days earlier, six members of a mine-removal team were killed and three others were abducted in an ambush by gunmen in western Herat province, a local police official said.
The United States is withdrawing most of its troops by year's end, reducing the primary leverage it has had in Afghanistan. But it still supports the country with billions of dollars in foreign aid.
The international community, which fears a resurgence of the Taliban, is keen to see Afghanistan continue on the path to democracy.
The Obama administration says it has no favored candidate but wants to see a credible and transparent process that produces a president who can bring Afghanistan together and govern effectively.
Senior administration officials said Friday that Kerry's meeting with the two candidates had focused on the need to preserve the gains Afghanistan has made over the past 13 years, through a legitimate political transition.
Conversations have focused on two main areas, the officials said: how to address allegations of fraud in a credible manner and restore confidence in the electoral process; and how to ensure political dialogue so the process is inclusive and produces as unified a government as possible.
The United Nations Assistance Mission in Afghanistan has been looking into the fraud allegations.
But the senior administration officials stressed that the political process must be Afghan-led.
Although once an ally of President Hamid Karzai, Abdullah has in recent years become an opponent and vocal critic of the Taliban. Ghani, also a former adviser to Karzai and finance minister, was once a U.S. citizen, but he gave up his passport to run for president five years ago.
The International Crisis Group, a nongovernmental organization, said in a news release Friday that Afghanistan had "reached a critical moment in the development of its democratic system." It urged both sides to engage in talks and to accept the outcome of investigations into the fraud allegations.
"The final result will be less important, however, than the way the contest is decided," the group added. "Such periods of transition are a crucial test for a country's institutions. This is a moment when Afghans must hold tight to their constitution and the rule of law, despite political turmoil."
After Saturday's meetings in Kabul, Kerry is expected to travel to Vienna, Austria, for talks on Iran's nuclear program.
Iran and six world powers, the United States among them, are engaged in a final round of negotiations ahead of a July 20 deadline aimed at reaching a permanent deal on the future of Tehran's nuclear program.
Tehran insists its ambitions are peaceful, but the world powers fear it has ambitions to build nuclear weapons.
Kerry is due to speak in Vienna with his German counterpart Frank-Walter Steinmeier, the senior administration officials said. The foreign ministers' encounter will come amid a row over fresh spying allegations against the United States.
Germany's government on Thursday asked America's top spy chief stationed in the country to leave.
This followed the revelation that two Germans -- one working at a German intelligence agency, the other in the Ministry of Defense -- are suspected of spying for the United States.
CNN's Jamie Crawford reported from Kabul. CNN's Laura Smith-Spark wrote in London and Michael Martinez in Los Angeles. CNN's Masoud Popalzai in Kabul contributed to this report.