Following victory at the October 1990 elections, Prime Minister Nawaz Sharif pursued economic reforms and privatisation and instituted Sharia (Islamic) law. In 1993 president and prime minister resigned under pressure from the military, making way for fresh elections which brought Benazir Bhutto back to power by a small majority.
In November 1996, President Sardar Farooq Khan Leghari, prompted by the army high command and opposition leaders, once again used the eighth amendment to the constitution, and dissolved the National Assembly, bringing down the Bhutto government and alleging corruption, financial incompetence, and human rights violations.
New elections were held in February 1997. The Pakistan Muslim League (Nawaz) – previously the main component of the Islami Jamhoori Ittehad – won 137 of the 217 seats in the National Assembly and Sharif became prime minister. Bhutto's Pakistan People's Party (PPP) retained only 19 seats.
In April 1997, Sharif was able to gain the PPP's support to achieve the two-thirds majority necessary to repeal the eighth amendment, ending the president's ability to dissolve the National Assembly. He also took over from the president the power to appoint Supreme Court judges and military chiefs-of-staff.
In October 1999, Sharif ordered the dismissal of Army Chief of Staff General Pervez Musharraf, and refused permission to land for the commercial aircraft in which he was returning to Karachi (from an official visit to Sri Lanka). The army countermanded the prime minister's orders and immediately seized power, dismissing the government and arresting Sharif. Musharraf justified his actions as necessary to restore both the economy and the deteriorating political situation. Pending the restoration of democracy Pakistan was suspended from the councils of the Commonwealth.
In June 2001, Musharraf dissolved parliament and the four provincial legislatures, President Rafiq Tarar resigned and Musharraf became president, further isolating the country.
After the terrorist attacks on the United States of 11 September 2001, Pakistan cooperated with the US and its allies in the war on terrorism, offering intelligence and allowing aircraft attacking Afghanistan to pass over Pakistani territory.
A referendum held in April 2002 confirmed Musharraf's position as president for a period of five years.
National Assembly elections in October 2002 produced a hung parliament. The Pakistan Muslim League–Quaid-e-Azam (PML-Q), which supported Musharraf, took 77 seats, followed by PPP with 63, Muttahidda Majlis-e-Amal (MMA; a new alliance of religious parties opposed to the US military presence in Pakistan) with 45, Pakistan Muslim League (Nawaz) with 14 and Muttaheda Qaumi Movement (MQM) with 13, leaving a large block of members of smaller parties and independents. The Commonwealth observer group present said that 'on election day this was a credible election', but that 'in the context of various measures taken by the government we are not persuaded of the overall fairness of the process as a whole'.
The first session of the parliament was convened by the government on 16 November 2002 amid uncertainty as to which party would form the next government. The National Assembly subsequently elected Chaudhry Amir Hussain (PML-Q) as speaker and Mir Zafarullah Khan Jamali (PML-Q) as prime minister. The continuing dispute between Musharraf and the opposition parties on the status of the Legal Framework Order (and especially his power to dismiss the prime minister and dissolve the Assembly) and Musharraf's own position as president and chief of army staff created political deadlock. Parliament was not functioning and the government ruled by decree. The MMA emerged as leader in the campaign against the Legal Framework Order as the Alliance for the Restoration of Democracy (ARD) – an alliance of PPP, Pakistan Muslim League (Nawaz), and several smaller parties – was weakened by the death of its leader and the absence of exiled leaders Benazir Bhutto and Nawaz Sharif.
In January 2004 Musharraf won confidence votes in the Assembly, the Senate and the four provincial assemblies. In May 2004, in view of the progress made towards democracy, the Commonwealth decided to readmit Pakistan to the councils of the Commonwealth. In June 2004 the prime minister resigned and was succeeded by Chaudhry Shujaat Hussain until July when he made way for finance minister Shaukat Aziz on his winning a seat in the Assembly. In December 2004 Musharraf announced he would continue as president and chief of army staff until 2007 when elections were due.
In the presidential election held on 6 October 2007 Musharraf was unofficially proclaimed winner pending a key ruling by the Supreme Court regarding his eligibility to run for presidency whilst serving as Army Chief of Staff. Many lawmakers resigned or boycotted the elections protesting at General Musharraf's candidacy in the election.
Exiled opposition leader Benazir Bhutto returned to Pakistan on 18 October 2007. In what was widely believed to be an attempt on her life, the convoy on which she was travelling on, from Jinnah International Airport en route to Karachi, was hit by explosions – the result of a suicide bomb. Bhutto survived, but approximately 136 people were killed and more than 400 injured.
Amid alleged national security concerns, four weeks after the presidential election, General Musharraf declared a state of emergency effectively suspending the country's constitution via a provisional constitutional order (PCO). With the declaration of emergency a news blackout was imposed on major private television stations. Several hundred arrests of protestors, journalists and Musharraf's political opponents were reported throughout the country – eight Supreme Court judges including the Chief Justice Iftikhar Muhammad Chaudary were deposed and put under house arrest for refusing to obey the PCO. As the situation developed General Musharraf came under increasing international pressure to restore the country's constitution and abide by the timetable for free and fair parliamentary elections. After a meeting in Kampala on 22 November, the Commonwealth Ministerial Action Group (CMAG), which addresses serious or persistent violations of the Commonwealth's values and principles, suspended Pakistan from the Councils of the Commonwealth, pending the restoration of democracy and the rule of law in that country.
The state of emergency was revoked the following month, by which time Musharraf had instated a new chief justice and a caretaker prime minister, Muhammad Mian Soomro. He had also resigned from his position as army chief and had been sworn in as president for a new five-year term.
Nawaz Sharif, leader of Pakistan Muslim League (Nawaz), was successfully permitted entry into the country following his return from exile, the second time he had attempted to do so that year; he was deported on arrival earlier in September 2007. By the end of November, both Sharif and Bhutto had personally filed papers to participate in the following parliamentary elections.
On 27 December 2007, whilst leaving an election rally in Rawalpindi, Pakistan People's Party Chairperson, Benazir Bhutto was killed in an assassination attack. Widespread violence ensued throughout the country. Bilawal Bhutto Zardari, Benazir's son 19 year-old son, was chosen as her eventual successor; her husband Asif Ali Zardari would lead the PPP de facto, as co-chair, until Bilawal was effectively able to. The elections, due for January, were subsequently postponed.
Elections eventually took place on 18 February 2008. Opposition parties won the most seats with the PPP winning the single largest number of seats but falling short of an absolute majority. Sharif's PML-N won the second largest number of seats while the party backing President Musharraf, the PML (Q), suffered huge losses. With no party securing a clear majority, the PPP, PML-N, Awami National Party (ANP) and Jamiat Ulema-e-Islam-Fazl (JUI-F) formed a coalition government headed by Yusuf Raza Gilani of the PPP, as prime minister.
On 12 May 2008, CMAG met in London and agreed that, since it last met on 22 November 2007, the Government of Pakistan had taken positive steps to fulfil its obligations in accordance with Commonwealth fundamental values and principles. It accordingly restored Pakistan to the councils of the Commonwealth.
Amidst warnings by the PPP and PML-N leadership of impeachment by Parliament, Pervez Musharraf announced his resignation as president in August 2008.
After securing 481 votes out of a possible 699 (in the National Assembly, the Senate, and the four provincial assemblies), the PPP's co-chair Zardari replaced Musharraf as the country's president the following month. With nine PML-N ministers resigning, Zardari's ascendancy to presidency signaled the end of a PPP and PML-N dominated coalition government and the beginning of a new one consisting of the PPP, ANP, JUI-F and MQM. The PML-N became the largest party in opposition.