By Syed Shoaib Hasan
BBC News, Islamabad
The most common reaction among Pakistanis over President Pervez Musharraf's consideration of emergency rule was one of disbelief.
There is a consensus among analysts and politicians that had he made such a move - from which he has now officially stepped back - he would have risked complete political isolation.
It would also have pushed him back into the cauldron of political agitation from which he has just emerged following his abortive move to suspend the country's chief justice - who has since been reinstated.
Pragmatism and sense has prevailed, although some analysts believe the president was given a "gentle push" away from emergency rule.
It is the return of Ms Bhutto - and the people power she is capable of generating - that is most feared
A call from US Secretary of State Condoleezza Rice is believed to have made a contribution, coming as it did within hours of the announcement by Pakistan's information minister that "the option of emergency is being considered".
Although government officials insisted the call was only to discuss the Pakistan-Afghan peace jirga and "other bilateral issues", President Bush's subsequent statement about free and fair elections was seen by many as confirmation that the US had played a role in defusing the crisis.
But most of all it is strong resistance from within the ruling regime that convinced the president.
As one insider put it: "National elections with all parties participating are no longer one of many options. In the current geo-strategic environment, they are the only choice Pakistan has for a viable future. We must make the army go back to the barracks."
The debate over emergency rule shows the deep fissures among President Musharraf and his advisers over the future course of action in relation to the elections.
The president backed down over his suspension of the chief justice
"The people advising the president to impose the emergency are his enemies," said Mushahid Hussain Syed, secretary-general of the ruling PML-Q party.
"They are the same people who advised him during the chief justice debacle."
The row over Chief Justice Iftikhar Chaudhry's suspension damaged the president's authority.
At the same time, the president has not yet developed a successful strategy to deal with increased Islamic militancy.
His decision last month to storm the Red Mosque in Islamabad - an assault in which more than 100 people were killed - led to the breakdown of a ceasefire with militants in the north of the country.
Since Muslim hardliners in the mosque were forcibly removed, militants have launched a series of suicide attacks on the army in North West Frontier Province and in the tribal areas.
President Musharraf's difficulties were compounded by the decision of the Supreme Court to reinstate Chief Justice Chaudhry, because it meant an independent and hostile judiciary at a time when national elections were around the corner.
The judiciary, with its newfound strength, could rule against Gen Musharraf's wearing of a uniform while also being president.
It could even provide exiled politicians such as former PMs Benazir Bhutto and Nawaz Sharif with an avenue to return to the country.
The president is thought to be keen to prevent this from happening, because if Ms Bhutto in particular was allowed to return, his bargaining position with her Pakistan People's Party (PPP) would be weakened.
Mr Sharif, along with his brother politician Shahbaz Sharif, has already filed a petition asking to be allowed to return to Pakistan.
The petition was heard by the Supreme Court on Thursday and is an early sign of the importance and influence of the judiciary as Pakistan reaches a critical juncture in its 60-year history.
On the eve of the Supreme Court taking up the case, news broke about the possible imposition of a state of emergency.
The news sent shockwaves through political circles. Politicians of all denominations condemned the news and said they would oppose it tooth and nail.
Critics say that the president should relinquish control of the army
Benazir Bhutto was especially outspoken.
"Some people... have been asking the president to declare an emergency over the past year," she said in a television interview. "President Musharraf would be well advised not to listen."
Some analysts believe that the president was tempted to declare an emergency, even martial law, to curtail the power of the court.
"He still believes that his having absolute power is vital to the country's interest," said one government official.
"For this reason he thinks it is essential to be president and head of the army."
For the time being, though, Gen Musharraf has resisted the temptation to take the easy road to power.
Whether this gamble will enable him to hold on to power while stabilising his volatile country remains to be seen.
It is the return of Ms Bhutto - and the people power she is capable of generating - that is most feared.
If she were to come back without a power-sharing deal, the writing could well be on the wall for President Musharraf.
"If Musharraf did declare an emergency, it would have been the last act of a desperate man," said Imran Khan, opposition politician and head of the Tehreek-e-Insaf (Justice) party.
"We need fair and free elections. Anything else will be a disaster for Pakistan."