The result of Afghanistan’s disputed election will be declared on Sunday, officials said Saturday, as last-minute talks between the two rival candidates continued on a proposed power-sharing deal.

The stalemate between Ashraf Ghani and Abdullah Abdullah since the June 14 vote has plunged Afghanistan into a political crisis as US-led NATO troops end their 13-year war against the Taliban.

Both men claim to have won the fraud-tainted election, and the United Nations and the United States have pushed hard for a “national unity government” to try to avoid a return to the ethnic divisions of the 1990s civil war.

Mujib Rahman Rahimi, a spokesman for Abdullah, said the two candidates were preparing to sign a deal.

“They are set to meet again shortly today to reach a final agreement,” he said. “The IEC is not supposed to announce the final results before the agreement is finalised.”

Ghani’s campaign team was not immediately available to comment, but said it would issue an update on negotiations later Saturday.

The election process has been plagued by delays and setbacks, and the latest timetable could still change if disputes flare up again over how the new government would take shape.

– Uneasy alliance? –

Ghani — who won the vote according to preliminary results — is set to emerge as president, with Abdullah nominating who will fill the new post of “chief executive officer”, possibly taking on the role himself.

Under the Afghan constitution the president wields almost total control, and the new government structure faces a major test in the coming years as the country’s security and economic outlook worsens.

President Hamid Karzai, whose successor was originally due to be inaugurated on August 2, was constitutionally barred from standing for a third term in office. He has stayed publicly neutral in the election.

About 41,000 NATO troops remain in Afghanistan, down from a peak of 150,000 in 2010, fighting along Afghan soldiers and police against the fierce Taliban insurgency.

NATO’s combat mission will end in December, with a follow-on force of about 12,000 troops likely to stay into 2015 on training and support duties.

The United Nations has expressed fears that an angry reaction to the election result could revive the violence of the 1990s, when nationwide chaos allowed the Taliban to come to power.

After the June election was engulfed by allegations of massive fraud, the US brokered a deal under which the two candidates agreed to abide by the outcome of an audit of all eight million ballot papers and to then form a national unity government together.

But Abdullah later abandoned the audit, saying it was failing to clean out fraud.

Only ten days ago, he insisted he had won fairly and that negotiations over the unity government had collapsed.

Street protests by either side’s loyalists risk spilling into serious unrest because Abdullah draws his support from Tajiks and other northern ethnic groups, while Ghani is backed by Pashtun tribes of the south and east.