By Chris Morris
BBC News, Islamabad
Mr Musharraf's rule was a setback to democracy
For nearly a decade Pervez Musharraf was the most powerful man in Pakistan.
His resignation marks the end of an era for a country facing enormous economic and security challenges.
He will be remembered for many things.
He overthrew an elected government in a military coup. He took Pakistan to the brink of war with India, only to launch a sustained peace process a few years later.
In the aftermath of the 11 September attacks in New York and Washington he declared his full support for the United States and became a key player in the American-led war on terror.
War on terror
He was also responsible for modernising many sections of Pakistani society.
But he brooked no opposition, and weakened important state institutions. And in the end he has fallen victim to hubris, the feeling that he was indispensable and he could do no wrong.
He leaves Pakistan as a more fragile and fractured country than it was when he came to power.
"There will be a more balanced view of him in the future than there is now," argues Mushahid Hussein, a leading political supporter.
"A lot of things happened in Pakistan for the good under his watch, and I think that is something the history books will recall after some time."
"As far as democracy in Pakistan is concerned," counters Senator Enver Beg of the Pakistan People's Party, "historians will not forgive him."
"He manipulated elections, he hounded his opponents, and he became a dictator. It's not much of a legacy."
His most significant international decision was to throw in his lot with George Bush and the United States after 9/11. He abandoned the Taleban in Afghanistan and worked closely with the Americans in pursuing Islamic extremism.
In return Washington has given Pakistan more than $10bn in aid, mostly to the military, since 2001.
Mr Musharraf leaves behind a fractured country
But many of the gains from this strategic alliance have been frittered away.
Pakistan's lawless border regions close to Afghanistan remain a sanctuary for al-Qaeda, and a new Taleban insurgency inside Pakistan has gradually been gathering strength.
Military co-operation with the Americans has also become increasingly unpopular in Pakistan. As President, Pervez Musharraf never managed to persuade a majority of his people that he was doing more than fighting someone else's war.
"He never tried to create an impression in Pakistan that we were fighting for our own country and our own good," says military analyst Talat Masood, a retired lieutenant-general.
"And because of that the Pakistan army became a client army and Pakistan became a client state in the eyes of the people. It was a major failing on his part."
On Pakistan's eastern border, relations with India have also been predictably volatile.
As army chief, Gen Musharraf launched a military adventure in Kargil in 1999, shortly before his military coup. Pakistani soldiers and Kashmiri militants infiltrated Indian territory, before pressure from the United States forced them to withdraw.
And then an armed attack on the Indian parliament in Delhi in 2001 prompted a rapid military build-up on both sides of the Indo-Pakistani border which brought South Asia's nuclear neighbours close to war.
But from 2004 onwards a peace process between the two countries, in which Pervez Musharraf invested a considerable amount of personal prestige, led to a ceasefire and a series of confidence building measures.
As Mr Musharraf leaves office, though, relations with India have fallen to another low ebb.
Pakistan faces huge challenges
The government in Delhi is convinced that a suicide bomb attack by Islamic militants on its embassy in Kabul last month was organised under the auspices of Pakistani intelligence agents.
At home Pervez Musharraf's first few years in power seemed to promise the hope of a fresh start and a modernising agenda. He liberalised the economy and the electronic media.
He backed the empowerment of women and made efforts to improve standards in education.
He also has the distinction of leaving high office with no serious charges of corruption against him. In Pakistan, that is quite a rare event.
But in the last 18 months he clearly over-reached himself. He thought he could take on the judiciary, the parliament and anyone else who disagreed with him with no consequence.
He sacked the chief justice, imposed a state of emergency and engineered his own re-election as president.
"He was too cocksure, he was overconfident," admits Mushahid Hussein. "But the ground realities had changed."
Critics say one of the most damaging parts of his legacy is the fact that his disregard for civilian institutions has weakened the Pakistani state.
He encouraged the spread of military influence into all walks of life, and always appeared more comfortable with men in uniform.
Pakistan's border regions are a haven for militants
"He didn't understand the importance of other institutions," says Talat Masood. "And he didn't understand that a country of 160 million people couldn't be ruled by just one man."
In some respects he was a victim of his own success.
The Musharraf era saw the emergence of a more assertive middle class, who were in the forefront of protests against his imposition of emergency rule.
But towards the end of his presidential career even the economic accomplishments he could claim as his own were tarnished by the sapping negativity of months of political crisis.
In July 2008 annual inflation was over 24%, while the value of the rupee fell dramatically as the long political stalemate dragged on.
"He overstayed his welcome," says Enver Beg of the PPP. "It's time for life without Musharraf, it's time to move on."