By Syed Shoaib Hasan
BBC News, Islamabad
The future looks brighter for the Pakistan People's Party
Yusuf Raza Gillani has been elected by a huge mandate by Pakistan's parliament to be the country's next prime minister.
The vote was accompanied by the almost traditional chants of "Go Musharraf Go".
For President Pervez Musharraf, once the country's supreme executive authority, it has been another bad day.
What looks like the beginning of the end of his powers began with the sweeping victory of political parties opposed to his rule last month.
They have now formed a coalition led by the Pakistan People's Party (PPP), of which Mr Gillani is a leading member.
The prime minister-elect wasted little time in making his own mark on this transformed political scene.
In a short address after the vote, he paid homage to the slain PPP head, former Prime Minister Benazir Bhutto.
And he fired his first verbal shots.
Mr Gillani (right) does not believe the official version of Ms Bhutto's assassination
Mr Gillani announced two key moves, both of which are a direct challenge to President Musharraf.
"I will immediately order the release of the judges," he said, detailing what his first executive decisions would be once he is sworn in on Tuesday.
Mr Gillani was referring to those members of the country's top judiciary who were sacked and then put under house detention by President Musharraf when he enforced emergency rule on 3 November.
President Musharraf had refused to release them, or restore them to their posts, even after lifting the emergency in December.
The judges had been due to rule on whether the then General Musharraf's recent re-election was constitutional and valid.
They had refused to give in to pressure to give "a positive decision" and said the matter would be decided "according to the law".
The re-election was then upheld by a new group of judges who took an oath of loyalty to President Musharraf following the enforcement of the emergency.
Mr Musharraf's political opponents and a movement of the country's lawyers have kept up the campaign for the restoration of the sacked judges.
As such, Monday's announcement, coming within minutes of Mr Gillani's election, is a clear signal to President Musharraf.
It marks the end of his role as the supreme executive authority in Pakistan.
According to the country's constitution, that power has always rested with the chief executive in the country, who is the prime minister.
President Musharraf had initially abrogated these powers to himself by way of a constitutional amendment which designated him 'chief executive'.
Later, he got his orders carried out by prime ministers widely seen as rubber stamps for his decisions.
All that, though, appears to be at an end.
The speed with which Mr Gillani's 'orders' were carried out speaks volumes about how times have changed.
New man in charge
They carry no legal weight until he has taken his oath and then received a vote of confidence from the parliament.
But, as observers point out, Pakistan's government bureaucracy is unnaturally prescient as to which voice is now the one to be obeyed.
Minutes after Mr Gillani's announcement, they rushed to do his bidding.
Police guarding the residence of the deposed judges began to remove the barricades and barbed wire around the sacked judges' residences.
Soon afterwards the judges, who had been in detention with their families for five months, were informed of their release.
Jubilant supporters cheered them as they emerged triumphant from their homes.
It is not difficult to imagine what President Musharraf must have felt about this.
After the emergency was lifted, he had said the sacked judges would only be restored "over my dead body".
But some political analysts believe the judges' release is a minor matter.
The real issue, they say, is whether the judges will get their jobs back.
Iftikhar Chaudhry was in detention for five months
That is something that Mr Gillani's PPP has not been keen on.
This is because the deposed judges were also set to rule on another matter before their dismissal - an immunity clause which gave amnesty to all politicians convicted or charged in "politically motivated cases".
These include senior leaders of the PPP, including its current chairman, Asif Ali Zardari, Ms Bhutto's widower.
Other observers believe that there will be little friction between the sacked judges and the PPP.
"It was a clash of egos between (Mr Musharraf) and the chief justice (Iftikhar Chaudhry)," says a lawyer involved in the movement for the judiciary's restoration.
"The judges are not going to get into a fight with the PM and parliament who have engineered their release."
But that does not mean they are willing to be similarly charitable to the president.
Already the released ex-chief justice and some of his colleagues have indicated they will still be seeking to rule on the president's re-election if they are reinstated.
All this could add to calls from governing coalition members for Mr Musharraf to be impeached.
And that is not all.
Mr Gillani has also said that he will, upon taking oath, call on the parliament to pass a resolution seeking a United Nations investigation into the assassination of Ms Bhutto last December.
The PPP, and her family, has refused to accept the official findings and has indicated they believe government officials were involved in the slaying.
That could further add to Mr Musharraf's discomfort.
In a recent interview, the president appeared quite despondent, and talked about how he would like to be remembered.
With a prime minister who has yet to take oath pulling rank on him, many believe the countdown to his last days has begun.