|Musharraf has been an ally of George Bush in his "war on terror" [File: EPA]
When asked in an interview with Al Jazeera's Darren Jordan early in 2007 what he would like his legacy as president of Pakistan to be, Pervez Musharraf said he wanted to be remembered as a "reformer and developer".
"[Pakistanis] must remember me as a reformer and developer, someone who saved them from catastrophe and introduced sustainable democracy," he said.
"That is what I would like to be remembered for."
However, with the coalition government calling for his impeachment and continuing violence in the tribal regions along the border with Aghanistan, Musharraf seems unlikely to fulfil this ambition.
'War on terror'
After the September 11, 2001 attacks on the United States by members of al-Qaeda, Pakistan became a country at the very forefront of US "war on terror".
This culminated in a tense standoff between Pakistani security forces and the country's clerics and students of the Red Mosque and Islamic school in Islamabad in July 2007.
Musharraf accused the Red Mosque's clerics and students of waging an increasingly aggressive campaign to enforce strict Sharia law in the capital.
As a result, the president ordered his security forces to storm the mosque, resulting in the deaths of more than 100 people.
Fighting in the country's northern tribal regions escalated following the controversial mosque seizure and suicide bombings became more common in Pakistan's cities.
The president's popularity sank after he declared a state of emergency on November 3, 2007, just days before the country's supreme court was to rule on his future as the country's leader.
Iftikhar Chaudhry, the chief justice, was sacked earlier in the year in March, for not signing the emergency order, sparking nationwide protests.
The supreme court, without Chaudhry and several other judges who were dismissed, subsequently ruled that Musharraf's re-election the previous month was legal despite the fact he had not stepped down as army chief.
After his re-election was confirmed he ended eight years of divisive military rule as was sworn in as a civilian leader.
Musharraf restored the constitution, but he did not reinstate the judges. As protests by lawyers denouncing his leadership gathered pace across the country, Musharraf was forced to reinstate Chaudhry in July.
In the subsequent parliamentary elections in February 2008, opposition parties trounced his allies and left him in a state of politcal limbo.
But opposition is something the 64-year-old has become used to since he came to power in a bloodless coup in 1999.
He has survived three assassination attempts and, perhaps quite aptly, his memoirs, published in 2006, were entitled In the Line of Fire.
|There have been growing opposition
protests against Musharraf [AFP]
After he ousted Nawaz Sharif, the then prime minister and now a leader in the coalition, from power, he promised he would bring "true democracy" to Pakistan.
Bill Clinton, the US president at the time, described the coup as "another setback to Pakistani democracy", and said "Pakistan's interest would be served by a prompt return to civilian rule and restoration of the democratic process".
But despite this initially frosty response, Musharraf's presidency has benefited greatly from his close ties with Washington.
After the attacks on the US on September 11, 2001, Pakistan became a key ally of the Bush administration in its so-called "war on terror" and Musharraf launched a major crackdown on perceived religious extremists, particularly in the country's rugged northwest.
That policy has caused some in Pakistan's remote provinces to label him a traitor.
Shortly after the coup in 1999, Musharraf consolidated his grip on power by requiring all judges to swear a new oath of allegiance to the military. Many stood down in protest.
The supreme court, now filled with loyalists, had declared new elections were to be held by October 2002. Prior to those general elections, Musharraf held a referendum on April 30 that extended his presidential term by five years after the vote in October.
The referendum was boycotted by opposition parties claiming that the vote was rigged. They then virtually paralysed the national legislature for more than a year.
The president had said he would remove his uniform at the end of 2004, but repeatedly postponed the move, only stepping down as the head of the military on November 28, 2007.
|Musharraf's relations with Chaudhry
have been strained [File: AFP]
In his memoirs he explains the decision to go back on his word: "Removing my uniform would dilute my authority and command when both were required the most. Therefore, I decided to go against my word."
During his tenure, Musharraf has improved relations with India and some observers say a generally independent media scene has been allowed to flourish.
Born in Delhi in pre-partition India in 1943, Musharraf is a lifelong military man and rose up the ranks to be appointed army chief-of-staff, over other senior officers, by Sharif in 1998.
However, relations between the two soon soured. The Kargil conflict in Kashmir in 1999 sparked tensions between the civilian government and the military.
After Sharif decided to remove him from his position, Musharraf carried out the bloodless coup that brought him to power.
Before settling in Karachi, Musharraf spent some of his childhood in the Turkish capital, Ankara, and speaks Turkish fluently.
He is married with two children and four grandchildren.