Afghan election commission workers sort ballots for an audit of the presidential runoff votes in front of international observers at an election commission office in Kabul on Wednesday. (Massoud Hossaini/Associated Press)

The Obama administration’s effort to ensure a smooth transfer of power in Afghanistan appeared to be unraveling Wednesday as the second-place candidate in a disputed presidential runoff announced a boycott of an ongoing recount.

Abdullah Abdullah, a former foreign minister, pulled his observers from the recount over what his advisers described as an illegitimate audit process that has failed to uncover hundreds of thousands of fraudulent ballots.

The decision stalled the recount Wednesday morning, but the Independent Election Commission of Afghanistan and the United Nations announced late in the day that the review of more than 8 million ballots would continue in the coming days.

Abdullah’s boycott is again creating uncertainty about the fate of a U.S.-brokered agreement that calls for Abdullah and former Afghan finance minister Ashraf Ghani, who placed first in the June runoff, to share power once the audit is complete.

After Abdullah protested the preliminary runoff results earlier this month, raising fears of civil unrest, Secretary of State John F. Kerry rushed to Kabul to negotiate that agreement. As concerns grew Wednesday that Abdullah could walk away from the deal, Kerry sent Dan Feldman, the U.S. special representative for Afghanistan and Pakistan, to Kabul.

Afghan election commission workers sort ballots for an audit of the presidential run-off votes in front of international observers at an election commission office in Kabu. (Massoud Hossaini/AP)

“We know there have been lots of ups and downs in the process, but we’re continuing to charge forward,” State Department spokeswoman Jen Psaki said.

Efforts to finalize Afghanistan’s next government — the second since a U.S.-backed military campaign toppled the Taliban in 2001 — have taken on more urgency because outgoing President Hamid Karzai plans to leave office Tuesday.

U.S. officials also had hoped that a new president would be inaugurated in time for him to attend next week’s NATO summit, where officials plan to discuss future commitments to Afghanistan.

Karzai will not attend the summit, spokesman Aimal Faizi said, because he does not support President Obama’s plans to keep several thousand U.S. troops in Afghanistan through the end of 2016.

“We certainly need the new president to go and attend the summit because he will have his own views on it,” Faizi said. “So we are working and hopeful that the two candidates will reach an agreement that will lead to a conclusion of the election process.”

But the election stalemate is creating widespread doubt about whether such a quick transition is possible.

Ghani, a former World Bank official, is a Pashtun who has strong support among fellow members of the ethnic group, Afghanistan’s largest. Abdullah, of mixed Pashtun and Tajik descent, draws most of his support from the Tajik community, the country’s second-largest ethnic group.

Abdullah had easily prevailed over seven other candidates in an initial round of voting in April but fell short of a majority, necessitating the runoff. Preliminary results from the runoff showed Ghani leading by more than 1 million votes.

In recent days, even some Ghani advisers have acknowledged the likelihood that fraudulent ballots were cast in the runoff.

Yet it does not appear that the audit will change the outcome, causing the Abdullah campaign to allege that the review process was not stringent enough.

Imam Mohammad Warymach, a spokesman for the Independent Election Commission, dismissed the Abdullah campaign’s charges as unfair. He said the audit is following procedures previously agreed to by both candidates.

Warymach said Abdullah’s withdrawal appeared to be “a political decision” stemming from his realization that he was unlikely to overcome Ghani in the audit. “Therefore,” Warymach said, “they decided to walk away.”

Mohammad Halim Fedai, a senior adviser to Ghani, said the Abdullah campaign’s decision was a “stamp on their defeat.”

“They know the results,” Fedai said.

But U.N. officials are stressing that they take Abdullah’s concerns seriously. Richard Chambers, a leading expert in electoral dispute resolution, arrived in Kabul from Britain on Wednesday at the behest of the United Nations to oversee the remainder of the audit.

“We are conscious of the need to respond to two contradictory pressures — on one hand, to maintain the integrity and thoroughness of the audit, and on the other hand, to expedite the process,” said Nicholas Haysom, the U.N. secretary general’s deputy special representative for Afghanistan.

Afghan lawmakers and analysts said the most urgent question is whether Abdullah and Ghani will reach an agreement on their respective roles in a unity government.

Ghafour Liwal, a Kabul-based political analyst, said Abdullah’s campaign is using the boycott to draw more concessions from Ghani about what powers the second-place finisher would hold in such a government.

Mohammad Mohaqiq, one of Abdullah’s running mates, appeared to confirm that strategy in an interview Wednesday night.

“We will never return to the audit process,” Mohaqiq said. “We will only continue the political talks, and if political talks collapse, we have other options, as well.”

Anne R. Gearan in Washington and Sayed Salahuddin and Sharif Hassan in Kabul contributed to this report.