By Syed Shoaib Hasan
BBC News, Islamabad
Saturday's move by Pakistan's ruler General Pervez Musharraf to implement emergency rule was not unexpected.
The timing of the emergency surprised many
The move was first considered as a possible option in August, soon after the Supreme court restored Chief Justice Iftikhar Mohammad Chaudhry.
Mr Chaudhry had been suspended by General Musharraf in March on allegations of abuse of power.
He denied the charges and was supported by Pakistan's lawyers and opposition political parties.
The subsequent storm of protests proved to be the sternest test General Musharraf had faced thus far.
Mr Chaudhry's restoration to full authority at the head of a judiciary openly hostile to General Musharraf led him to consider the option of emergency in early August.
But the general pulled back from the brink, although many of his ministers continued to stress that the option remained.
"It is a part of the constitution", a senior minister recently told the BBC.
"It can and will be used when needed."
But the fact that the option has been used sooner rather than later caught many an observer unawares.
Nightmare come true
The decision comes at a time when Pakistan's Supreme Court was hearing a crucial case concerning General Musharraf's eligibility to continue as president.
Benazir Bhutto's level of support was a concern for the government
He has already been elected, in a vote held last month.
But the Supreme Court had said he could not take oath till they had ruled on his contested eligibility criteria.
As the case dragged on, insiders say the General's frustrations were compounded by the return of his erstwhile "ally" Benazir Bhutto.
The contours of a political deal with her Pakistan People's Party, the country's largest, were agreed to before the homecoming.
But the massive turnout of support for her in Karachi led to several weak knees in the government.
With parliamentary elections around the corner, such a show of strength was a nightmare come true for General Musharraf's political party, PML-Q.
Dragging it out
The situation was compounded by the judiciary's continued reluctance to reach a quick decision.
Analysts point out every day the case dragged on was a point scored for Mr Musharraf's opponents.
But just as much as the political imbroglio, it was the growing loss of morale in Pakistan's armed forces which was a source of concern.
The army has suffered reversals in the tribal areas
Pakistan's army, deployed throughout the country's tribal regions to combat pro-Taleban militants, was losing ground to them.
The last straw, in this regard, came when at least 300 army troops surrendered to militants in South Waziristan.
Since then, the government and its security troops have all but lost control to the militants in the tribal areas.
The emboldened militants have subsequently moved forward into settled regions - Pakistani territory where normal law applies.
The most recent of these is the growing insurgency in the Swat valley.
Such political and security situations are not unprecedented in Pakistan's history.
But what has changed is the public's access to information about events, due to extensive and critical media coverage.
Reporting of the militants' challenge to the state, starting with the siege at Islamabad's Red Mosque in July, has been quite comprehensive.
Added to the live reporting on the political storm surrounding the chief justice, this has been critical in shaping opinion.
Mass protests have been few so far, but that could change
These factors have not gone unnoticed by General Musharraf, who expounded on them during his speech after imposing emergency.
While claiming that Pakistan stood on the brink of catastrophe, he was quick to point the finger of blame.
For him, the two main culprits, who are now likely to face the brunt of the emergency, were the judiciary and the media.
Within hours of the announcement that emergency had been enforced, members of the Supreme Court were detained and a new chief justice appointed.
Changes were also made in all the provincial high courts, with all judges having to take oath under the new provisional constitutional order.
But that was not all.
General Musharraf has also included several provisions for the media, which cannot now publish or broadcast any statements by militants.
Any criticism of the head of state, members of the armed services and any other senior member of government is banned.
Anyone breaking these rules faces a three-year jail term and a 10 million rupee ($167,000) fine.
Given that General Musharraf has said he will now do his utmost to bring the situation under control, it is a law that may soon be used.
The imposition of emergency also means the executive orders cannot be challenged in what are likely to be, in any case, pliant courts.
But analysts believe this will have the opposite effect from that for which General Musharraf hopes.
"Both the judiciary and the media have been avenues through which dissent against the regime has been increasingly channelled," one points out.
This has prevented a large participation by the general public in anti-Musharraf protests.
This could well change now that the emergency is in place.
General Musharraf talked of the need to bring the country back from the brink of disaster.
But he did not specify when elections, the generally agreed formula to take the country forward, would be held.
This could be the turning point for the general as he descends further into his labyrinth.
It may also force his PPP allies to reconsider their positions.
If that happens, Pervez Musharraf's opponents could well end up having the last word.