A by-election was held for the Dewan Rakyat parliamentary seat of Permatang Pauh on 26 August 2008 with nomination day on 16 August 2008. The seat of Permatang Pauh in the Dewan Rakyat, fell vacant after the resignation of the incumbent, Datuk Seri Wan Azizah Wan Ismail, on 31 July 2008. Wan Azizah was the Leader of the Opposition as well as the President of the Parti Keadilan Rakyat (PKR), a component party of the opposition Pakatan Rakyat (PR) coalition. The by-election was contested by the PR candidate former Deputy Prime Minister Anwar Ibrahim. This election has been dubbed "the mother of all by-elections" by the media due to the potentially significant implication of the election as well as the high profile of Anwar Ibrahim.
Anwar won the election and was sworn into Parliament on 28 August 2008, vowing to topple the government with the help of defectors from Barisan Nasional.
On 27 July 2008, Anwar said that he aimed to return to parliament for the first time in a decade later this year if a court ordered a by-election near his home town. The seat mentioned would probably be Kulim-Bandar Baharu constituency next to his hometown of Permatang Pauh in Penang. Anwar Ibrahim on 31 July 2008 said he would contest a by-election for the parliamentary seat of Permatang Pauh vacated by his wife to expedite his return to political office. His wife Wan Azizah said she handed her letter of resignation to the parliament speaker on Thursday 31 July. Party officials said the by-election must be held within 60 days. The Election Commission (EC) had fixed the nomination day for the Permatang Pauh by-election on 16 August, with polling to be held ten days later on 26 August. Some 58,459 voters in the Permatang Pauh constituency would be eligible to vote on 26 August, a working Tuesday, adding that the figure also include 490 postal voters.
Anwar Ibrahim was charged on 7 August 2008 for sodomy under Section 377B of the Penal Code, fuelling speculations over a possible conspiracy on the part of the Malaysian government to derail his election campaign.