On 27 July 2008, Anwar said that he aimed to return to parliament for the first time in a decade later that 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 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, fueling speculations over a possible conspiracy on the part of the Malaysian government to derail his election campaign.
Ibrahim said: "Barisan Nasional is clearly overwhelmed. It's no longer a by-election. It's more than that." Deputy Prime Minister Najib Razak admitted the ruling party was the underdog: "It is going to be an uphill task but nothing is impossible in politics."
By-election results
Early results indicated a landslide victory for Anwar. Reuters reported "Anwar Ibrahim has won with a majority of 16,210 votes. According to news website : Anwar won 26,646 votes, while the government's Arif Omar won 10,436 votes. Anwar's People's Justice Party spokeswoman Ginie Lim told BBC: "We won already. We are far ahead." Malaysia's government and ruling coalition declared defeat in a landslide victory in by-election by Anwar Ibrahim. Muhammad Muhammad Taib, information chief of the United Malays National Organisation which leads the Barisan Nasional coalition stated: “Yes of course we have lost... we were the underdogs going into this race.“ Malaysia's Election Commission officials announced Anwar won by an astounding majority against Arif Shah Omar Shah of United Malays National Organisation. Final results announced by the Election Commission reveals Anwar Ibrahim won 31,195 of the estimated 47,000 votes cast in the district in the northern state of Penang, while rival Arif Shah Omar Shah got only 15,524 votes and a third candidate had 92 votes.