As at 10.05pm:
Final official EC tally - Anwar got 31,195 votes, Arif Shah, 15,524, Hanafi, 92. Anwar won with a majority of 15,671.
The official voter turnout was 81.1 percent, or 47,410 out of 58,459 registered voters - which was much higher than what the EC had stated earlier. There were 599 spoilt votes.
Meanwhile, outside Tuanku Bainun Teaching Institute, thousands of jubilant PKR supporters have gathered to embrace their leader's return to Parliament.
PKR vice-president Azmin Ali is already there to address the crowd numbering some 6,000. Other party leaders like R Sivarasa and Tian Chua are also there.
Anwar is expected to address this ecstatic group of supporters later as well. Tian said that the overwhelming victory showed that "the prime minister's racial politics is bankrupt".
The EC made the official announcement at 10.05pm. Only Anwar and Hanafi were present at the announcement.
As at 9.12pm:
Official EC result: With 11 more boxes to go, Anwar has won the by-election with a 14,551 majority. He garnered 27,977 votes while BN's Arif Shah obtained 13,426 while Akim's Hanafi Hamat got 85. His wife, Dr Wan Azizah Wan Ismail, won the seat with a 13,400 majority in the March 8 general election.
As at 9.25pm:
Official EC results: With final five ballot boxes to go, Anwar has bagged 29,526 votes, Arif Shah (14,444) and Hanafi (89). Majority so far: 15,082.
Crowd shouts 'reformasi' as Anwar votes
Azmin in fiery mood
Lim Guan Eng at PKR's huge final rally
BN concedes defeat in by-election
Aug 26, 08 8:55pm
The Barisan Nasional ruling coalition has declared defeat in a by-election against opposition leader Anwar Ibrahim who will return to parliament after a decade-long absence.
"Yes, of course, we have lost... we were the underdogs going into this race," said Umno information chief Muhammad Muhd Taib.
Anwar's PKR, which leads a three-member opposition alliance, claimed a "landslide" victory. It said Anwar had garnered at least 65 percent of the ballot and that the figure could rise as high as 70 percent.
"We declare victory, the margin is very huge," said PKR information chief Tian Chua.
Muhammad said Umno had been hampered by internal disagreement over the choice of its candidate in the by-election, Arif Shah Omah Shah, and was distracted by upcoming internal leadership polls.
Dismissed talk of defections
"There are factors that we have to be practical about but this does not mean that he is enjoying full support elsewhere in the country," he told AFP.
"He is the winner here because this is his hometown and the timing of the elections is to his advantage because Umno's party polls will be held in a month."
Muhammad also dismissed talk that the victory would help Anwar oust the government with the help of defecting lawmakers, after landmark March general elections that handed the opposition unprecedented gains.
"I don't think so. In the last general election, the people gave the Barisan Nasional the mandate to rule, so if the opposition wants to form a government they will have to wait for the next general election."