The signing – broadcast live on national TV – comes after months of wrangling following presidential elections in April and June.
Under the deal, Ashraf Ghani becomes president while runner-up Abdullah Abdullah nominates a CEO with powers similar to those of prime minister.
Both sides had accused the other of fraud following the election.
The final result of the bitterly contested poll is due to be announced later.
Ashraf Ghani and Abdullah Abdullah signed the agreement at a ceremony inside the presidential palace in the capital, Kabul. They then stood and embraced each other.
The power-sharing deal was finally reached after a comprehensive audit of all eight million votes which began in July.
The agreement says the new CEO will be answerable to Ashraf Ghani, although he has lost a battle to be sworn in after the announcement of the election result.
Instead, the two men have signed the national unity agreement before the election result is announced.
The new chief executive – nominated by Abdullah Abdullah – will be side-by-side with the president when he is inaugurated.
Abdullah Abdullah will be able to appoint senior positions on terms of “parity” with Ashraf Ghani. The agreement says “the two teams will be equally represented at the leadership level”.
However, there will not be a one-for-one handout of jobs further down and that could lead to arguments.
The agreement calls for a spirit of partnership. But after a bitter election campaign and months of wrangling, the stability of this government cannot be guaranteed, he adds.
A spokesman for Ashraf Ghani said that there was no longer any dispute between the two sides.
“Both camps have agreed 100% on everything and we’ll sign the deal tomorrow,” Faizullah Zaki told Reuters on Saturday, September 20.
The audit of ballots was part of a deal brokered in July by Secretary of State John Kerry to try to avert a descent into violence.
Both candidates pledged to accept the audit results and form a unity government.
One of the new president’s first tasks is widely expected to be signing a bilateral security agreement with the US.
The deal will allow a small force of soldiers to remain beyond 2014 to train Afghan security forces.
Incumbent President Hamid Karzai has refused to sign the security agreement, which is linked to the continuation of aid needed to pay Afghan civil servants, teachers and soldiers.
Ashraf Ghani and Abdullah Abdullah have both promised to sign the agreement.
E5V6U7IjuT0The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…