With PPP chief Benazir Bhutto -- the other leading political player in Pakistan -- already in exile, Musharraf declared himself the country's chief executive and formally appointed himself president on June 20, 2001, days before travelling to Agra for the much-hyped summit with then Indian prime minister Atal Bihari Vajpayee, which failed to yield any breakthrough.
In an attempt to legitimise his presidency, Musharraf staged a widely criticised referendum on April 30, 2002, to extend his term to five years and the pro-Musharraf PML-Q, a breakaway faction of Sharif's party, won a majority of seats in general elections later that year.
On January 1, 2004, Musharraf won a confidence vote from the electoral college comprising the five legislatures. This body then re-elected him in uniform on October 6, 2007, for a second term as president.
Musharraf garnered support from Pakistan's long-time friend America, by assisting the US-led forces in Afghanistan in the war against terrorism that ensued after the September 11, 2001, attack on the World Trade Centre.
Image: Pakistani lawyers celebrate the resignation of President Pervez Musharraf during a march on a street in Karachi on August 18, 2008.
Photographs: Rizwan Tabassum/AFP/Getty Images
Also read: The rise & fall of Pervez Musharraf