Ashraf Ghani, a former finance minister who will be named president under the deal reached on Saturday night, embraced rival Abdullah Abdullah after they signed the agreement in a ceremony broadcast live on television.
The new administration faces huge challenges in fighting an emboldened Taliban-led insurgency and paying its bills amid plummeting tax revenue.
It will also face significant difficulty in improving the lives of ordinary Afghans who face hard times as aid flows fall and as contracts with the NATO-led coalition dry up as most foreign troops leave by the end of the year.
The power-sharing deal was signed even though the final results of a hotly contested June 14 run-off vote have yet to be released. The signing ceremony took place at the presidential palace still occupied by outgoing leader Hamid Karzai.
One of Ghani’s first acts will be to sign a long-delayed bilateral security agreement with the United States to allow a small force of foreign troops to remain in Afghanistan after 2014.
The deal, brokered by US Secretary of State John Kerry, was swiftly welcomed by Washington.
“This agreement marks an important opportunity for unity and increased stability in Afghanistan,” said a statement issued by the office of the White House Press Secretary.
“We continue to call on all Afghans—including political, religious, and civil society leaders—to support this agreement and to come together in calling for cooperation and calm.”
It will also come as a relief for Afghans, who have watched the tortuous process play out since they first voted in April.
The drawn-out election was meant to mark the first democratic transfer of power in Afghanistan’s troubled history but the disputes between Ghani and Abdullah, a former foreign minister, ruined hopes for a smooth transition.
Karzai has ruled since soon after the Taliban government was ousted by US-backed Afghan forces in late 2001.
The uncertainty surrounding the political transition 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.
Ghani and Abdullah finally struck a power-sharing deal on Saturday, their aides said. As part of that deal, the winner would become the new president and the runner-up would nominate a chief executive with newly expanded powers.
Teams from the Ghani and Abdullah camps met late into Saturday night to try to finalize the power-sharing deal before the planned release of results of a UN-monitored audit of all 8 million ballots cast in the June run-off.
The Independent Election Commission had said it would announce the final results of the recount later on Sunday. However, no announcement had been scheduled by midday (0730 GMT), and commission members could not be reached for comment.
One of the last sticking points in the power-sharing negotiations was how to announce the election results. Abdullah had sought to either not announce the final tally—which he considers irrevocably tainted by fraud despite the UN audit—or to adjust the numbers to give him more votes.
Both sides said late on Saturday that the dispute over announcing results had been resolved but it was still unclear exactly what had been agreed upon.