Pakistan's Supreme Court kept the fate of President Pervez Musharraf's re-election bid in its hands by deciding a vote could go ahead on Saturday, but a winner cannot be declared until it rules if he was eligible to stand.
U.S. ally General Musharraf is sure to win the vote in parliament and the country's four provincial assemblies.
But the court's decision to keep open a possibility of disqualification could weaken his position and deepen a sense of mounting uncertainty in nuclear-armed Pakistan.
Delivering the ruling, judge Javed Iqbal said the court wanted more time to consider the merits of last-gasp opposition challenges to Musharraf running while still army chief.
Rivals were at least relieved that Musharraf won't be awarded victory on Saturday, even though they wanted the vote postponed.
"It is a partial relief for us. Today's order is the first step towards our victory," said Hamid Khan, a lawyer for Wajihuddin Ahmed, a retired judge running against Musharraf.
Independent analysts said the situation was finely balanced.
"General Musharraf has got procedural approval by the court but he has not yet been given full legitimacy. Uncertainty will continue until a decision is given," said Talat Masood, a retired general turned analyst.
The court has scheduled the next hearing for October 17.
The case is being heard by a bench of 10 judges, who are believed to be less receptive to the government than a bench that dismissed challenges to Musharraf's candidacy a week ago.
Musharraf's current term of office is due to end on November 15, and he has vowed to quit the army if elected and be sworn in as a civilian leader eight years after taking power in a coup that ended a decade of civilian rule with Pakistan virtually bankrupt.
The uniform is important to Musharraf because as long as he remains army chief he could declare emergency rule or martial law -- options he has said he won't take.
WAITING FOR BHUTTO
The setback for Musharraf came after a week in which several pieces needed to secure his future appeared to fall into place.
After frantic negotiations with self-exiled opposition leader Benazir Bhutto, Musharraf appeared on the brink of an accord with a potential ally who could shore up his position after a general election due by mid-January.
Former prime minister Bhutto plans to end more than eight years of self-exile on October 18, and lead her Pakistan People's Party in the election.
The two leaders have hardly had a good word to say about each other in the past decade, but have long been regarded as natural allies against militancy and the growing influence of religious conservatives.
The first stage of a power-sharing deal appeared settled on Friday when Musharraf signed a so-called National Reconciliation Ordinance that will erase 11 pending corruption charges against Bhutto and her husband. Other politicians and civil servants were also cleared of graft charges leveled before 1999.
But the ordinance excluded Nawaz Sharif, the prime minister Musharraf ousted and exiled in 1999, and blocked from returning last month, as he has been convicted of corruption.
Bhutto said on Thursday once the reconciliation pact was in place, her assembly members would not join other opposition parties trying to spoil the credibility of the presidential election by quitting parliament. She said her members would abstain or vote for their own candidate.
It was unclear how the Supreme Court ruling on Friday might affect the incipient deal with Bhutto.
Musharraf needs a new pillar of support, as the ruling Pakistan Muslim League is expected to fare badly in the polls.
People are fed up with military rule, rising prices, and an alliance with the United States that they see as behind deteriorating internal security.
The fate of Musharraf and Pakistan is being closely watched, especially by Western nations who have troops in Afghanistan and feel threatened by al Qaeda militants hiding on the Pakistani-Afghan border.
Until this year there was little political threat to him, but after an ill-judged attempt to oust the Supreme Court chief justice in March, Musharraf alienated a previously docile judiciary and sparked a pro-democracy lawyers' movement.
In interviews this week, Musharraf has spoken of his desire to oversee Pakistan's transition back to civilian rule, and ensure the general election is free and fair.
"Pakistan is really on a one-way, irreversible path to genuine constitutional democracy," said Nasim Zehra, an independent analyst.
(Additional reporting by Augustine Anthony and Zeeshan Haider)