Afghanistan Presidential Candidates Abdullah Abdullah and Ashraf Ghani
Afghanistan’s rival presidential candidates Abdullah Abdullah, left, and Ashraf Ghani stand together after exchanging signed agreements for the country’s unity government in Kabul Sunday. Reuters/Omar Sobhani

KABUL, Afghanistan (Reuters) -- Afghanistan’s rival presidential candidates signed a deal Sunday to share power after months of turmoil over a disputed election that destabilized the nation at a crucial time as most foreign troops prepare to leave. Ashraf Ghani, a former finance minister who will be named president, embraced rival Abdullah Abdullah after they signed the power-sharing agreement at a ceremony watched by outgoing President Hamid Karzai, and broadcast live from his palace.

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, with most foreign troops leaving by the end of the year.

The accord was brokered by U.S. Secretary of State John Kerry, who swiftly welcomed its signing. “These two men have put the people of Afghanistan first, and they’ve ensured that the first peaceful democratic transition in the history of their country begins with national unity,” he said.

Under the terms of the deal, the winner will have to share power with a chief executive proposed by the runner-up, and the two will share control over who leads key institutions such as the Afghan army and other executive decisions.

One of Ghani’s first acts would be to sign a long-delayed bilateral security agreement with the U.S., as he has previously declared support for the pact to allow a small force of foreign troops to remain in Afghanistan after 2014.

There is a risk that any instability could be exploited by neighbors, such as Pakistan, whose past meddling in Afghan affairs have played a part in the conflicts that have dogged Afghanistan for decades.

“A difficult and challenged unity structure is still preferable to conflict between these two groups,” said a U.S. official. “Having them both working together within the government and direct their energies toward positive reform is again preferable to some of the alternatives.”

Ghani, an ethnic Pashtun, and Abdullah, whose main support comes from the country’s second-largest ethnic group, the Tajiks, face a difficult task forging unity in a country riven by ethnic and tribal rivalries.

Abdullah’s accusations that the run-off election was rigged in Ghani’s favor had raised fears of ethnic violence, which could have ignited a broader conflict.

“A spark could have dealt a strong blow to the political process, if today’s deal had not happened,” said Waliullah Rahmani, director of the Kabul Center for Strategic Studies. “But, we have crossed that moment.”

Waiting For Result

The final touches of the power-sharing deal were thrashed out late Saturday, as the Independent Election Commission prepared to release results of a United Nations-monitored audit of all 8 million ballots cast in the June run-off. The commission planned on releasing the final results of the recount Sunday, but it was unclear whether the size of Ghani’s winning margin would be given as Abdullah’s team has argued that the audit failed to properly adjudicate on fraud. The disputed preliminary count had shown Ghani won with 56 percent of the vote.

Ghani is expected to be sworn in as president within a week, according to Karzai representative Aimal Faizi.

Under the terms of the accord, Abdullah, a former foreign minister, would be allowed to nominate a chief executive with newly expanded powers.

The settlement will also come as a relief for Afghans, who have watched the tortuous process play out since they first voted in April.

Karzai has ruled since soon after the Taliban government was ousted by U.S.-backed Afghan forces in late 2001, and the drawn-out election was meant to mark the first democratic transfer of power in Afghanistan’s troubled history.

“Afghanistan will now be able to move forward for the next five years, even though it is not an ideal government,” Rahmani said.

(Reporting by Hamid Shalizi and Jessica Donati; Additional reporting by Kay Johnson; Editing by Paul Tait, Simon Cameron-Moore and Mark Potter)