Updated

Afghanistan's election commission named Ashraf Ghani Ahmadzai as the winner of the country's presidential election Sunday, hours after Ahmadzai signed a power sharing agreement with opponent Abdullah Abdullah, who will fill the newly created position of government chief executive.

An Ahmadzai supporter -- Halim Fidai, a former governor -- said Sunday that U.N. representative Jan Kubish told the commission not to release detailed vote tallies.

The United Nations had been monitoring an audit and recount of the approximately eight million votes cast.

The decision underscores the fear of potential violence despite Sunday's deal. A senior U.S. official said the vote result is transparent but may be released slowly over fears of violence. The official insisted on anonymity because he was not authorized to be identified publicly.

The power-sharing deal cleared the way for final approval of a bilateral security agreement that would keep some U.S. troops in the country beyond this year.

Under the terms of the deal, former Finance Minister and World Bank official Ahmadzai will replace Hamid Karzai as Afghanistan's president. The agreement also creates the post of chief executive, which will be held by Abdullah.

"I am very happy today that both of my brothers, Dr. Ashraf Ghani and Dr. Abdullah Abdullah, in an Afghan agreement for the benefit of this country, for the progress and development of this country, that they agreed on the structure affirming the new government of Afghanistan," Karzai said after the signing ceremony, which was broadcast on national television in Afghanistan and capped off by a hug and handshake between the two rivals.

A statement from the White House expressed its support of the agreement, saying in part, "This agreement marks an important opportunity for unity and increased stability in Afghanistan.  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."

U.S. Secretary of State John Kerry first got the candidates to agree in principle to share power during a July visit to Afghanistan. Kerry returned to Kabul in August and has spent hours with the candidates in repeated phone calls in an effort to seal the deal.

In a statement released early Sunday, Kerry called the agreement "a moment of extraordinary statesmanship. 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."

Reuters reported that under the terms of the deal, the president and chief executive would be able to decide who held a near-equal number of government positions.

The announcement of the results had been one of the final sticking points, with Abdullah initially claiming that the results were so tainted by fraud that they should not be made public. It was unclear exactly how the issue was resolved.

Abdullah believes he won the first round of the election back in April by a margin of more than 50 percent, which would have precluded a runoff. But the official results showed him winning about 45 percent of that vote in a crowded presidential field of 10, not quite enough for an outright victory.

He also believes he won a June runoff with Ghani. But official totals -- which the election commission said it would release on Sunday -- show Ghani with about 55 percent of the vote.

As talks dragged out, Abdullah's mostly northern supporters threatened to form a parallel government or react violently to any outright victory by Ghani. For his part, Ghani said he always maintained that ethnic politics in Afghanistan demand some sort of power sharing deal and not a winner-takes-all government.

The U.S. had insisted on a democratic transition in Afghanistan as a requirement for the security deal that would allow for nearly 10,000 American troops to remain in the country following the end of combat missions after this year. The pact was brokered between Kerry and Karzai late last year and approved by Afghanistan's loya jirga council, but Karzai refused to sign the agreement. Ghani and Abdullah both said that they would sign the deal.

NATO Supreme Allied Commander in Europe Gen. Philip Breedlove said Saturday in Lithuania that NATO officials had spoken with both candidates and confirmed that both had promised a "quick signature" to the security agreement.

"I wouldn't want to speculate on how fast, but we're hoping for very fast signatures," Breedlove said, adding that approval of the agreement would open the way not only for U.S. troops to remain, but also for NATO to begin a training mission dubbed Resolute Support starting in January.

The Associated Press contributed to this report. 

Click for more from The New York Times.

Click for more from Reuters.