KABUL - Rival candidates in the bitterly disputed Afghan presidential election will sign an agreement on a unity government on Sunday, aides said, potentially easing months of tension that destabilized Afghanistan while foreign troops withdraw.The signing ceremony to be held at the Kabul presidential palace - still occupied by outgoing leader Hamid Karzai despite an election process that began in April - will coincide with the planned announcement of final results.The announcement follows a UN-monitored audit of all 8 million ballots cast in a June run-off vote that had been disputed by both major candidates - former World Bank official Ashraf Ghani and former foreign minister Abdullah Abdullah.Ghani and Abdullah struck a power-sharing deal on Saturday, their aides said. As part of that deal, former finance minister Ghani will most likely become the new president and Abdullah chief executive with newly expanded powers, although when those moves will come into effect remains far from clear.The election was showcased by Afghanistan's foreign backers as the first democratic transfer of power in Afghanistan's troubled history but the drawn-out dispute ruined hopes for a smooth transition from Karzai, who has ruled since soon after the Taliban were ousted in late 2001.The uncertainty emboldened the Taliban-led insurgency to launch more attacks across Afghanistan, just as the newly trained Afghan security forces prepare to lead the fight against the militants on their own after foreign troops withdraw.Teams from the Ghani and Abdullah camps met late into Saturday night with UN representatives to try to finalize the power-sharing deal before the release of the audit results.The final bone of contention had been how the vote tally would be announced. Aides and officials have said Abdullah insisted that the official percentages of the votes either not be made public or be altered to give him more votes. Abdullah is widely seen as trailing Ghani in the tally.The election commission did not respond to a request for comment on how the results would be announced. Abdullah's camp said no numbers would be released because there had been so much electoral fraud that fraudulent votes could not be accurately separated from real ones.While it was still not clear how the dispute was finally resolved, all sides in the talks agreed late on Saturday that the deal was done."Both camps have agreed 100 percent on everything ... Everything has been initialed and there is no disagreement on anything," said Faizullah Zaki, a spokesman for Ghani.Aimal Faizi, a spokesman for Karzai, said the deal would be formally signed at the presidential palace on and that the candidates had agreed on the announcement of results, although he gave no other details.Preliminary figures released in July put Ghani ahead with 56 percent of the June 14 run-off vote, prompting street protests from supporters of Abdullah who alleged massive fraud and said he was the rightful winner.The political crisis threatened to rekindle the ethnic tensions that plunged Afghanistan into civil war in the 1990s. Abdullah derives much of his support from the ethnic Tajik and Hazara communities, while Ghani is widely supported by the Pashtuns, Afghanistan's largest ethnic group.The audit of the run-off was part of a deal brokered in July by US Secretary of State John Kerry to try to avert a descent into violence.Abdullah and Ghani pledged to accept the audit results and form a unity government with the winner - presumably Ghani - as president and the runner-up either becoming chief executive or nominating someone for the post with newly expanded powers.Just how much power the chief executive would wield was one of the main stumbling blocks.