KABUL (Reuters) - Former Afghan finance minister Ashraf Ghani was named president-elect on Sunday after he signed a deal to share power with his opponent, ending months of turmoil over an election that destabilized the country as most foreign troops prepare to leave.
Ghani's administration must now not only forge an effective government after so much acrimony, but also deal an emboldened Taliban-led insurgency that is bringing near-daily attacks across the country.
In announcing the pact, authorities withheld the final election numbers, apparently as part of the political deal between Ghani and rival Abdullah Abdullah, a former foreign minister who claimed the vote was rigged against him.
"The Independent Election Commission of Afghanistan declares Dr Ashraf Ghani Ahmadzai as the president of Afghanistan," commission chief Ahmad Yousuf Nuristani said.
Under the terms of the unity deal, Ghani will share power with a chief executive proposed by Abdullah. The two will share control over who leads key institutions such as the army and other executive decisions.
Nuristani acknowledged deep flaws in a June 14 run-off vote and said a U.N.-supervised audit was not adequate to weed out all vote-rigging. The audit was organized at a cost of $10 million to be paid with U.S. aid money, according to the United Nations.
The final sticking point in the negotiations to form a unity government was Abdullah's insistence that the official final vote tally not be released, his aides have said. Abdullah was widely believed to be far behind in the official results.
He appeared to have won a concession to at least delay making the results public, though Nuristani said on Sunday the full count would be provided at a later date.
Ghani and Abdullah ratified the power-sharing agreement earlier on Sunday at the presidential palace, joined by outgoing leader Hamid Karzai. The rivals-turned-partners shared a brief embrace after signing.
Ghani is expected to be sworn in as president on Sept. 29, according to a senior official.
The negotiated end to the crisis was far from the smooth election process that the U.S. and its allies had envisioned. They had hoped for a plausible democratic transfer of power ahead of the end of the military mission that started with the 2001 ouster of the Islamist Taliban for sheltering al Qaeda leaders behind the Sept. 11 attacks on the United States.
Still, after weeks of election uncertainty that at times seemed about to descend into political and ethnic violence, the resolution was greeted with relief by many Afghans.
"The six-month election deadlock damaged life for Afghans," Kabul resident Mohammad Alim said. "We didn't have normal sleep, investors fled from Afghanistan, people were worried about their future ... but today people are relaxed and happy."
But the government will face significant difficulty in improving the lives of Afghans who face hardship as tax revenues plummet, aid flows fall and contracts with the NATO-led force dry up with most foreign troops leaving by the end of the year.
The accord signed on Sunday was the finalization of a broader power-sharing structure brokered by U.S. Secretary of State John Kerry, who welcomed its signing.
Speaking in New York before the start of U.N. meetings, Kerry said the naming of a new president was an opportunity to sign a bilateral security agreement (BSA) with the United States.
"(The deal) offers a huge opportunity for progress in Afghanistan, for the signing of the BSA in a week or so, inauguration next week for the new president," Kerry said before a meeting with his French counterpart.
One of Ghani's first acts would be to sign the long-delayed security agreement as he has previously declared support for the pact to allow a small force of foreign troops to remain in Afghanistan after 2014.
Many in Kabul fear instability could be exploited by the Taliban, who have made significant gains in the south and east, taking advantage of gaps in U.S. air support this summer fighting season.
A U.S. official in Kabul said the deal to end the election dispute was far from ideal, but preferable to many alternatives that could pose a greater threat to stability.
Some Afghans worry that the competing interests of powers that seek influence in their country - including Iran, Pakistan and India - may play into how the U.S.-brokered deal works out, a complaint often raised by outgoing President Karzai.
"Afghanistan’s enemies and neighboring countries ... are waiting to see if this agreement brings a crisis," said Kabul member of parliament Qurban Ali Erfani, listing enemies as "the Taliban, some foreigners and our neighboring countries".
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," commented Waliullah Rahmani, director of the Kabul Center for Strategic Studies.
"Afghanistan will now be able to move forward for the next five years, he said, "Even though it is not an ideal government."
Additional reporting by Kay Johnson and Mirwais Harooni in Kabul and Lesley Wroughton in New York; Editing by Robert Birsel