General elections were held in Pakistan on 18 February 2008 to elect members of the 13th National Assembly and the four Provincial Assemblies. 
On 3 November 2007 President Pervez Musharraf enacted a state of emergency; elections were initially postponed indefinitely. However, it was later stated they would be held as planned. On 8 November 2007 Musharraf announced that the elections would be held by 15 February 2008, before suggesting a date of 8 January. Following the assassination of former Prime Minister Benazir Bhutto in December 2007, the Election Commission conducted a meeting and announced that 8 January was no longer a feasible date and the elections would be held on 18 February.
The elections saw the resurgence of the Pakistan Peoples Party (PPP) and Pakistan Muslim League (N) (PML-N), as they emerged as the two largest parties in the National Assembly. Following Bhutto's death, the PPP had come under the leadership of her nineteen-year-old son Bilawal. However, the party's election campaign was led by Benazir's husband and Bilawal's father Asif Ali Zardari, in his capacity as the co-chairman of the party. Meanwhile, PML-N was under the leadership of Chaudhry Nisar Ali Khan, although the party's eponymous founder Nawaz Sharif had returned from exile and was taking part in the Election campaign. At the provincial level, the PPP won in Sindh, the PML-N dominated in Punjab, the Awami National Party emerged as the largest party in North-West Frontier Province and Musharraf's Pakistan Muslim League (Q) won the most seats in Balochistan. Around 35.2 million people voted, with voter turnout just 44%.
Musharraf conceded the defeat of his party and pledged to work with the new Parliament. Due to a common mistrust of Musharraf, the PPP and PML-N initially formed a coalition government. Although Ameen Faheem was expected to lead the new government, PPP leaders agreed to appoint Yousaf Raza Gillani as Prime Minister. Within a week, the PML-N left the coalition to lead the impeachment movement and a campaign to restore the judiciary. The PPP instead formed a government with the Muttahida Qaumi Movement, Awami National Party and Jamiat Ulema-e-Islam (F).
By-elections for 28 seats (23 provincial and five national) were delayed numerous times, with most of them held as late as 26 June 2008.
Terrorism.
Since 2004, there was a sharp rise of terrorism incidents took place during the presidency of General Pervez Musharraf. A serious incident took place in Red Mosque located in Islamabad when Police's special forces conducted an armed raid in the Mosque. The general elections were dealt with a great shock on 27 December 2007 when Benazir Bhutto was assassinated while leaving a rally in Rawalpindi. Bhutto's assassination raised many questions as to whether the general election would be postponed. Following the fatal attack, Pervez Musharraf held an emergency meeting with other government officials, but stated that "no decision had been made on whether to delay the national elections."
Benazir Bhutto had "become an appealing solution" to United States officials frustrated with President Musharraf's failure to restore democracy to Pakistan, "The New York Times" said.
The PML(N) stated after the assassination that his party would boycott the election. The PML(N) later stated that the party would take part if PPP contests the election. The PPP then decided to name Benazir Bhutto's son, Bilawal Bhutto Zardari, the new party leader with his father Asif Ali Zardari as co-leader, as asked for in Benazir Bhutto's testament. The party also decided that it would contest the elections and stated that the elections should be held as planned.
The Election Commission announced after a meeting in Islamabad that an 8 January vote was no longer possible and the election would take place on 18 February.
Pre-election violence.
In the weeks preceding the election, there were several attacks targeting leftist politicians and political rallies. On 9 February, a suicide car bomb killed 27 and injured 37 attending a political rally for the Awami National Party in Charsadda. On 16 February, another suicide car bomb that killed 37 and injured 93 outside the residence of PPP candidate Riaz Shah in Parachinar. The same day, a suicide attack on an army outpost in Swat Valley killed two civilians and injured eight people. A polling location in Bajaur was destroyed by militants earlier.
Issues.
Code of conduct.
Code of conduct for the election has been proposed by the Citizens' Group on Electoral Process (CGEP) to the Election Commission of Pakistan and the political parties. This suggests that all stakeholders should agree on a set of rules as early as possible, in order to provide a level playing field for a fair general election.
Terrorism.
There have been concerns from the United States that Pakistan has not been doing enough to assist in their war on terrorism. Musharraf has rejected such claims, stating "The fight against terrorism and extremism, whether it is al-Qaeda or Taliban, can never succeed without Pakistan's cooperation and Pakistan is the only country that has delivered the maximum on both. We are tackling them with 30,000 troops. If there is anybody who is not doing enough, it is others who are not doing enough." Opposition parties, especially the religious Muttahida Majlis-e-Amal coalition, are opposed to Pakistan's role as ally of the United States in the War on Terrorism. A car bomb killed 40 people and wounded 90 16 February 2008 in northern Pakistan when it exploded in front of an election office of the opposition Pakistan Peoples Party.
Fairness of elections.
To ensure the transparent elections the Free and Fair Election Network (FAFEN) played a vital role in election monitoring. A part from this number of opposition parties called for the resignation of President Pervez Musharraf to ensure free and fair elections under a caretaker government. On 8 July 2007 opposition parties issued a declaration of their demands for the elections. The parties included were the Pakistan Peoples Party, Pakistan Muslim League (N) and Muttahida Majlis-e-Amal. Regarding the election, the declaration had the following clauses:
Former Prime Minister Pakistan Ch. Shujaat claimed that United States managed results of 2008 general elections. In a televised interview with Channel 5 of Pakistan on 31 March 2017, Ch. Shujaat claimed that American authorities along with the then Senator (who became vice-president thereafter) Joe Biden visited him two days before general elections of 2008 at his (Shujaat) residence in Lahore and said that US would not accept election results if his (Shujaat) party won
 ;templatestyles src="Template:Blockquote/styles.css" / ;
Campaign.
Party alliances.
Thirty-two parties opposed to Musharraf have joined in a loose political alliance called All Parties Democratic Movement; the PPP, one of the main parties, was not a part of this alliance.
As Musharraf had stated that the elections would be held under the state of emergency, at least three parties stated they will boycott such elections, fearing that they would not be free and fair: the PML (N), Jamaat-e-Islami and Tehreek-i-Insaaf.
The opposition parties jointly stated that the elections could not be fair, as most opposition candidates were in jail under the state of emergency and thus unable to file nomination papers for the election.
On 23 November 2007 PPP members were given the go-ahead to register for the elections, while still reserving the decision to boycott the election.
Imran Khan, the Tehreek-i-Insaaf leader, restated his call for a boycott on 23 November 2007, the day the APDM was to decide on whether to boycott the elections jointly.
Upon his return to Pakistan on 26 November 2007 Nawaz Sharif stated he would run in the elections only if the state of emergency was lifted before the polls, and that he would not serve as Prime Minister under Musharraf. However, Sharif's candidacy was rejected on 3 December due to his prior criminal conviction.
On 10 December 2007 Sharif and Bhutto finally announced they would not boycott the election, despite their fears that the election would be neither free nor fair.
Pakistan Peoples Party.
The Pakistan Peoples Party (PPP) campaigned on wide range of issues, including country's role in terrorism, nationalization, immigration and foreign policy. The PPP is a centre-left political party and promotes the proponents of social democracy. During the election campaign, Benazir highlighted the success of computer literacy programme that was launched in 1993 and gas pipelines infrastructure that was initiated in 1995.
Pakistan Muslim League (N).
The Pakistan Muslim League-N's political campaign was led by Nisar Ali Khan, in the absence of Nawaz Sharif. The PML(N) is a centre-right political party and primarily targeted the Pervez Musharraf and PML(Q)'s government initiatives to resolve the law and order situation in the country. Due to Pervez Musharraf baring Nawaz Sharif to return to the country, the PML-N's campaign was restricted in all over the country.
Electoral support.
In a poll from the International Republican Institute conducted from 19 to 29 January, the PPP led with 50%, followed by PML-N with 22% and Musharraf's PML-Q with 14%. The ultraconservative Muttahida Majlis-e-Amal (MMA) had 1% and Muttahida Qaumi Movement (MQM) 1%. Due to its unprecedented lead in the opinion polls, most commentators believed PPP could win a landslide victory. However, the actual results were much smaller for PPP. In the first three counts to finish, the opposition did well: The provincial assembly seat in Baluchistan went to the PPP—the party of assassinated former Prime Minister Benazir Bhutto—while two independent candidates won seats from the northern tribal areas. Unofficial returns 19 February 2008 showed huge wins for the opposition parties of former Prime Ministers Nawaz Sharif and the slain Benazir Bhutto, one day after a pivotal vote that could threaten Pakistani President Pervez Musharraf's political viability. Pakistan's two main opposition parties, the PPP and the PML (N) announced 21 February 2008 they would form a new government together after their victory over President Pervez Musharraf's allies in elections the week of 18 February 2008. Shortly after making their coalition official, Pakistan's main opposition parties, the Pakistan Peoples Party and the Pakistan Muslim League (N), on 9 March 2008 called on President Pervez Musharraf to immediately convene parliament (Majlis-e-Shoora).
Results.
Results indicated that PPP and PML(N) secured the largest popularity votes in the elections– both campaigned on targeting Musharraf and had been politically active against Musharraf since 2003. The PML(Q) of Musharraf eminently faced the defeat, including 22 higher officials of the PML(Q) who were the cabinet ministers which constituted a bulk of the previous federal cabinet.
The PML(Q)'s president, Shujaat Hussain and Chief Minister of Punjab Pervez Illahi lost their respected seats. Others belonging to PML(Q) who also lost the elections includes:
On 21 February, it was announced that the PPP and the PML (N) would form a coalition government. The coalition would also include the Awami National Party.
National Assembly.
Following the election, seven independents joined the PPP, whilst three joined PML-N.
By-elections.
By-elections for 28 seats (23 provincial and 5 national) were delayed numerous times and were being contested, among others, by Nawaz Sharif (who initially stated he had withdrawn, but then appeared to be contesting the election nonetheless; his brother Shehbaz Sharif will also run in the by-elections) and Asif Ali Zardari.
The by-elections had originally planned for 3 June 2008, then postponed to 18 June 2008; a further planned postponement to 18 August 2008 due to security reasons met with large-scale opposition, leading to a rescheduling at the time to 26 June 2008. PPP announced it would not run in the by-elections which prominent leaders of the PML-N would contest. On 23 June 2008 Sharif was again banned from the election due to his earlier court conviction, leading the Supreme Court on 25 June 2008 to postpone the by-election for Sharif's seat until after appeal deliberations which begin on 30 June 2008 are concluded. By-elections for the other seats were held as planned on 26 June 2008.
59 candidates contested the five national seats, while the 282 candidates contesting the provincial seats were divided as follow:
Unofficial results showed that PML-N had won three national seats and PPP the other two; of the provincial seats, PML-N won eight, PPP seven, the Awami National Party two and independents six. Turnout was reportedly low.
Government formation.
Due to a common mistrust on Pervez Musharraf, the PML(N) agreed to form a coalition government after succeeding with an agreement reached in March 2008. The PPP appointed Yousaf Raza Gillani as Prime Minister over the populist Amin Fahim. After taking the oath and appointing a cabinet, Prime Minister Gillani worked toward consolidating the power to weakened Pervez Musharraf.
The PML(N) on the other hand consistently worked towards building efforts to lead a successful movement