Even before the final results were in, the legitimacy of Afghanistan's presidential election was being questioned.
The June 14 runoff between Abdullah Abdullah and Ashraf Ghani was marred by allegations of widespread fraud, with each candidate claiming victory and neither appearing willing to accept defeat.
Abdullah boycotted the election process over what he called "blatant fraud" committed in favor of Ghani, whom he accused of benefitting from 2 million fake votes. Ghani countered by arguing that the election was relatively clean, and that he won by more than 1 million votes.
As Afghans awaited the release of preliminary results expected on July 6 or 7 to be followed by a lengthy complaints period, a number of possible scenarios were shaping up.
Compromise Is Struck
In public, Abdullah and Ghani have expressed little desire to hash out a deal that could resolve the deadlock.
But privately, each candidate has held UN-mediated talks with the Independent Election Commission (IEC). And outgoing President Hamid Karzai and his two vice presidents -- Yunus Qanuni and Karim Khalili -- have also held talks with the respective candidates.
The meetings have yielded little so far, but observers say a possible power-sharing agreement is a possibility, regardless of which candidate comes out on top.
Nasrullah Stanikzai, a political-science lecturer at Kabul University, notes protests in Kabul and rising ethnic tensions and concludes: "Considering recent events, it seems likely that they will come to an agreement. Politically, it is the correct way, although it is also unlawful."
Unofficial results indicate that Ghani, who finished 13 percentage points behind Abdullah in the first round in April, appears to be heading for a second-round victory that would give him the upper hand in any talks.
In that event, Abdullah could concede defeat, at least privately, to Ghani. In return, Abdullah could be offered a prime-ministerial role and/or the promise of cabinet positions in the future government for his political allies.
It is worth remembering that Abdullah and Karzai cut some sort of deal during the fraud-tainted 2009 presidential election, although it has never been revealed what Abdullah received in exchange for pulling out of the race before his second-round runoff against Karzai. Abdullah, under immense local and international pressure, said he did not think the vote would be fair. But many believe he was given incentives for conceding defeat.
As ethnic tensions have escalated amid the election deadlock, fears have risen that the country could return to the type of interethnic violence seen in the 1990s. Rhetoric between rival candidates has sharpened and threats of violence have been traded. Pro-Abdullah protesters, meanwhile, have not discounted resorting to force if their demands are not met.
Abdullah, who is half-Tajik, half-Pashtun, has strong support among the Tajik community in the country's north. Ghani is a Pashtun whose main support base lies in the Pashtun heartland, in Afghanistan's south and east.
This has helped fuel predictions that the situation could turn violent.
But Zubair Shafiqi, a Kabul-based political commentator, is doubtful of such an outcome. "The people are tired of war," he says. "War is being imposed on them but the people will not accept it. The country will not fight a civil war because of either Ashraf Ghani or Abdullah."
On the other hand, Graeme Smith, a senior analyst at the International Crisis Group in Kabul, says if there is no agreement tensions could rise in the country's relatively peaceful north.
READ MORE: Antisocial Networking Prompts Calls For Twitter, Facebook Ban
Ghani's second vice-presidential running mate, former Uzbek warlord Abdul Rashid Dostum, and one of Abdullah's main backers, Balkh Province Governor Atta Mohammad Noor, are sworn enemies. It is not a stretch to imagine their struggle for control of the north spilling over into violence. "I think the concern is that the war could get a new northern dimension if northern groups start fighting in the same way that southern groups are already fighting," Smith says.
Some observers go so far as to warn that if an acceptable power-sharing agreement is not reached, the country could be partitioned. "If there is no deal, some people from the north will declare their independence from the central government," says Ahmad Saeedi, a Kabul-based political analyst. "They have already told the Americans of their intentions."
Karzai Stays On
Some Afghans hold the outgoing president responsible for the current crisis and say he has engineered the mess to extend his stay in power.
If Abdullah and Ghani cannot resolve their differences, Karzai could in theory be in a position to remain in power until a solution is found. Karzai's constitutional mandate expired in May, but he could continue on as an interim leader. And because he and his two vice presidents have become mediators in talks between Ghani and Abdullah, Karzai might be in a position to shape the outcome.
Abdullah has accused the outgoing president of using the government's administrative resources in favor of Ghani. Abdullah has also accused Karzai of rigging the vote so he can maintain control over the next government.
"This scenario was orchestrated by Karzai," says Saeedi, who adds that Karzai is setting the stage for a run for the presidency in five years' time. "Karzai wants the next government to be very weak, discredited, and considered unlawful."
Shafiqi, however, says it is in Karzai's interest to successfully oversee the country's first-ever democratic transition of power. "He wants to be remembered as the first Afghan leader to relinquish power and consolidate democracy in the country," he explains.