The package of amendments to Pakistan's constitution that have just been approved by parliament legitimise all the actions and deeds of General Pervez Musharraf since he seized power in a military coup four years ago.
It also appears to make him one of the most powerful presidents in the history of Pakistan, a country that, in formal terms, has a parliamentary form of government.
Islamic lawmakers hold power in Pakistan's North West Frontier Province
As a military ruler, General Musharraf had already declared himself as president in 2001.
But since then he has remained conscious of the fact that, without the necessary endorsement by parliament, all his decisions would remain questionable.
He has played his cards well.
In the end, the groups that have always pretended to be his biggest critics - the Islamic parties - have bailed him out by providing the constitutional legitimacy that he so badly needed.
No prior consultation
From President Musharraf's point of view the most crucial clause that has been added to the Constitution is Article 270-AA, which validates all his actions since his 1999 coup.
It reads: "The Proclamation of Emergency of October 14, 1999, all President's Orders, Ordinances, Chief Executive's Orders... shall not be called in question in any court or forum on any ground whatsoever".
The US fears the North West Frontier Province may become a shelter, if not a training ground, for the Taleban
The alliance of hardline Islamic parties, the MMA, had given the impression that their agreement with the government would curtail some of the powers General Musharraf had assumed for himself.
However, he will continue to remain a very strong head of the state.
General Musharraf will be president until 2008. He will also stay on as head of the army for at least one year.
He will have the authority to dismiss Pakistan's national and provincial assemblies without first consulting the supreme court.
He will also be able to continue with his social and economic reforms and determine Pakistan's regional and international policy goals.
Later on he will also be able to form a National Security Council that will directly involve the armed forces in the government's formal decision-making process.
The only significant concession he has made to the Islamists is to shed his military uniform by December 2004 - that is a verbal agreement.
Despite being faced with one of the biggest parliamentary oppositions in Pakistan's history, General Musharraf never had any doubt in his mind that at the time of his own choosing he would get the necessary constitutional backing for his actions.
Musharraf has escaped two assassination attempts this month
This is exactly what the latest changes to the constitution have done.
And without the support of the Islamic parties, it would not have been possible to get the required two-thirds majority in parliament.
The Islamic groups had appeared implacable in their opposition to General Musharraf following his reaction to the 11 September attacks on the United States in 2001.
He reversed Pakistan's regional policy, withdrawing support for Afghanistan's Taleban regime and he joined the US-led campaign against terror.
That aroused the ire of both the Islamic political parties and Pakistan's many Islamic militant groups.
His subsequent crackdown against some of the militant religious groups has been followed by two assassination attempts in quick succession in December - Islamic extremists have been blamed for the attacks.
The Islamic political groupings, like the MMA, also remained opposed to his many other decisions, and often accused him of toeing a Western agenda both at home and in the region.
Reasons for a deal
So why then, has the MMA now decided to provide General Musharraf with his much-needed constitutional legitimacy?
Islamist parties have become a growing force
Some analysts say that the long-standing co-operation between the army and senior religious leaders - what is known in Pakistan's as the so-called military-mullah alliance - is still intact.
It came into existence at the time of former military ruler, General Zia-ul-Haq, where the Islamists were used as the bulwark for the army's domestic and regional policy objectives.
General Zia, himself a conservative Muslim, openly supported and nurtured various Islamic groups to counter the mainstream political parties opposed to his rule.
This military-mullah alliance has suffered some setbacks in recent years because of President Musharraf's liberal policies and his decision to dump the Taleban.
But because of Pakistan's changing realities, the Islamic political parties have been adjusting some of their policies and started to distance themselves from the militant Islamic groups.
After nearly five decades of political struggle they have made big inroads in domestic politics.
Following parliamentary and provincial elections in October, 2002, the Islamic parties were able, for the first time, to form their own government in the North West Frontier Province (NWFP) bordering Afghanistan. They also make significant gains elsewhere in the country.
Analysts believe the MMA wants to retain its control in NWFP. It is highly likely that it may have been given a verbal assurance to continue its Islamic reforms agenda in the province, without any resistance from Islamabad.
So, for an old ally of the military, it may not have been a bad bargain to allow another military-ruler to become a legitimate head of the state, with extra-ordinary powers.
With President Musharraf now having his required legitimacy, he is in a position to crackdown on Islamic extremists with greater zeal, even at the cost of annoying the Islamic political alliance
The Islamist government in NWFP has continued to be a concern to the United States because it remains sympathetic to the Taleban.
The US fears the province may become a shelter, if not a training ground, for the Taleban, now a resurgent force in Afghanistan.
But even if the central government in Islamabad decides to look the other way to the strict Islamic code that the MMA government plans to introduce in the province, it is highly unlikely that the it will allow the place to become a breeding ground for militancy.
With President Musharraf now having his required legitimacy, he is in a position to crackdown on Islamic extremists with greater zeal, even at the cost of annoying the Islamic political alliance.