Thank you for following Malaysiakini's live reports
This wraps up Malaysiakini's coverage of the Semenyih by-election.
Reporting by Kow Gah Chie (team leader), Haspaizi Zain, Wong Kai Hui and M Fakrull Halim; photography by Lim Huey Teng and Azneal Ishak; KiniTV ground video team Baharuddin Suarnur, Azfar Afandi Zulkfley, Vivian Yap, Faye Liow, Faidzal Mokhtar and Mastura Malak; graphics and social media blasts by Syariman and Ewe Ying Yenn; analysis by Andrew Ong.
To cover the by-election today, Malaysiakini deployed half its editorial team and nearly the entire KiniTV team. If you like what we do, support independent media by subscribing to Malaysiakini for as low as RM0.55 a day. Details here.
Malay support: Small dip for Harapan, massive leap for BN
9.50pm - Malaysiakini estimates that Pakatan Harapan received 37.73 percent of the Malay vote during Semenyih by-election, down from 44.25 percent during GE14.
As for BN, Malaysiakini estimates its Malay support level to be at 59 percent, a massive leap from 35.33 percent during GE14.
However, this can be attributed to signs that voters who backed PAS during GE14 had voted for BN this time around.
The most obvious swing areas were the Kantan Permai and Bukit Mahkota polling districts, which host middle-class Malay-majority suburbs.
Although Harapan won both polling districts with more than 50 percent of the vote share during GE14, an estimated 8 percent swing gave BN more than half the votes there today instead.
The turnout in these two polling districts are estimated to be about 70 percent each, which is 3 percent lower than the official constituency-wide turnout of 73.24 percent.
The data would suggest that rural Malay voters were slightly more motivated to vote than their counterparts in the suburbs.
Aiman thanks Mahathir, says will continue serving Semenyih people
9:30pm - Pakatan Harapan candidate Muhammad Aiman Zainali appears at the coalition's main operations centre and is greeted with consolation hugs and applause.
The 31-year-old has just lost his first election but maintains that Harapan tried its best. He also vows to continue in politics.
"I would like to thank Harapan leaders especially (Bersatu chairperson) Dr Mahathir (Mohamad) and (Bersatu president) Muhyiddin Yassin, as well as the party machinery who have worked hard to help in this by-election.
"I will continue to serve the Semenyih people and to work to strengthen the party," Aiman tells the media.
However, the Bersatu man declines to comment when asked if he feels that he has let Harapan down.
OFFICIAL: BN takes Semenyih
9.25pm: Dewan Seri Cempaka - The Election Commission announces BN's Zakaria Hanafi as the winner of the Semenyih by-election.
Zakaria won 19,780 votes, 1,914 more than Harapan's Muhammad Aiman Zainali's (17,866). This is followed by PSM's Nik Aziz Afiq (845) and independent Kuan Chee Heng (725).
BN's vote share is 50.44 percent, up from 30.88 percent during GE14. This can be attributed to the coalition having secured votes from PAS supporters.
Meanwhile, there were 650 spoilt votes.
PSM and Kuan lose deposit
9.25pm - Independent Kuan Chee Heng and PSM's Nik Aziz Afiq will not be able to claim back their deposits of RM5,000 each.
PSM had 2.16 percent of the vote, down from 2.76 it secured during GE14.
However, it still did marginally better than social activist Kuan, who secured 1.82 percent of the vote share.
9.20pm: Dewan Seri Cempaka - As the results are being announced, both Pakatan Harapan's Muhammad Aiman Zainali and PSM candidate Nik Aziz Afiq Abdul are conspicuously absent at the tallying centre.
Meanwhile, the BN camp is chanting loudly, with cries of "Allahuakbar", former premier Najib Abdul Razak's slogan "malu apa bossku" and "Long live the rakyat, long live BN" ringing out.
Najib arrives at tallying centre
9.02pm: Former prime minister Najib Abdul Razak arrives at the tallying centre.
He is warmly greeted by BN members as supporters take turns to take selfies with him.
Najib had promised last night that he would come to the tallying centre should BN candidate Zakaria Hanafi win the Semenyih by-election.
This is Najib’s second by-election involvement with his ‘Bossku’ persona, which he debuted during the Cameron Highlands by-election.
8.50pm: BN leaders, led by Umno vice-president Khaled Nordin and some 30 coalition members, arrive at the tallying centre in good spirits.
Independent candidate Kuan Chee Heng, or ‘Uncle Kentang’ arrives soon after and thanks members of the media for their support.
"We (defeated candidates) should come and congratulate the winner. We are gentlemen," says Kuan.
Selangor PAS information chief Roslan Shahir Mohd Shahir is also present.
Syed Saddiq apologises to voters
8.53pm - Bersatu Youth chief Syed Saddiq Syed Abdul Rahman is among the first Pakatan Harapan leaders to react to the unofficial results.
He takes to Twitter to apologise to Semenyih voters for the ruling coalition's seemingly shocking defeat in the state polls.
Despite official results not being announced yet, Syed Saddiq also proceeds to congratulate BN for wresting back the seat.
"Congratulations BN on your win in Semenyih.
"To the Semenyih people, I put my hands together and apologise for any shortcomings.
"Thank you to the Harapan machinery for working hard. Our family will continue to move forward while reflecting on what has happened," he tweets.
8.40pm - Although the Election Commission is yet to announce the official results, Umno Youth chief Asyraf Wajdi Dusuki is declaring victory for BN.
Tweeting a photograph featuring him and party acting president Mohamad Hasan, acting deputy president Ismail Sabri and secretary-general Annuar Musa, Asyraf thanks Semenyih voters for their support.
"At the BN command centre with BN top leadership. Alhamdulillah, unofficial results show that BN has won the Semenyih state seat. Thank you to all of Semenyih!" Asyraf writes.
Please support Malaysiakini, be a subscriber
For 20 years, Malaysiakini has been covering elections, big and small. This involves heavy investments - in time and human resource - to play electoral watchdog and help voters make informed choices.
If you like what we do, support independent media by subscribing to Malaysiakini for as low as RM0.55 a day. Details here.
Unofficial: BN wins Semenyih, first seat to change hands since GE14
Malaysiakini is calling the Semenyih by-election in BN's favour. This is the first seat to change hands since the last general election, according to unofficial results.
BN's Zakaria Hanafi has garnered 18,864 votes as of 8.20pm.
According to Malaysiakini's calculation, BN's share of the vote, at present, is 49.98 percent, followed by Harapan 45.97 percent, PSM (2.22 percent) and Kuan Chee Heng (1.82 percent).
With just one polling station yet to confirm the results, Bandar Tasik Kesuma which is going BN's way, the coalition is poised to recapture the seat it lost in GE14.
Pakatan Harapan's Muhammad Aiman Zainali is trailing by 1,514 votes, having secured just 17,350 votes.
With this victory, BN now has five seats in the Selangor state assembly, while Harapan's seat share is reduced to 50. PAS has one seat.
BN leads by more than 1,500 votes
8.10pm - BN has extended its lead over Pakatan Harapan once again with more than 1,500 votes.
According to unofficial results, BN now has 18,864 votes while Harapan has 17,350.
Independent candidate Kuan Chee Heng has 689 votes whereas PSM 838 votes.
BN snatches five polling districts from Harapan
8.10pm - According to the unofficial count, BN has snatched at least five polling districts from Harapan.
The five polling districts are - Bukit Mahkota, Kantan Permai, Bandar Rinching Seksyen 5-6, Penjara Kajang and Beranang.
Capturing Bukit Mahkota and Kantan Permai is significant for BN because these were polling districts which Harapan won with 52.45 percent and 54.71 percent of the vote share respectively.
This means that there was a significant vote swing in these two Malay-majority polling districts.
Voter turnout estimated to be 73.3pct
8.05pm – The final voter turnout for the Semenyih by-election is estimated to be 73.3 percent.
This is the highest turnout for any by-election since the last general election.
The second highest by-election turnout was in Cameron Highlands, where 70 percent of voters cast their ballot.
Harapan narrows gap, BN lead reduced to 600
7.45pm: Pakatan Harapan has narrowed the gap. BN is now leading with 610 votes.
According to unofficial results, BN now has 17,067 votes while Harapan has 16,457.
Independent candidate Kuan Chee Heng has 628 votes whereas PSM has 782 votes.
Indian voters appear to back Harapan
7.40pm: Data from the unofficial count suggests that Pakatan Harapan's support level among non-Malays are intact, albeit marginally lower in most voting districts where non-Malays make up the majority.
However, the Bandar Rinching Seksyen 1-4 polling district, which has the highest number of Indian voters in the constituency (48.2 percent), saw Harapan's vote share virtually intact at about 59.5 percent.
BN snatches several polling districts from Harapan
7.25pm: There are 24 polling districts, including "advanced voters", in Semenyih.
So far, BN has managed to snatch two from Haparan - Penjara Kajang and Beranang.
According to the unofficial count, BN is also the likely winner in 11 polling districts while Harapan in four.
'Uncle Kentang' concedes defeat, tells supporters not to be sad
7.20pm - Taking to social media, independent candidate Kuan Chee Heng, who is known as 'Uncle Kentang', conceded defeat. He told his supporters to remain calm and not to feel sad for him.
“Don't worry about me. I am ready for a huge defeat. We have created a network for the people who are suffering in Semenyih.
"Uncle's dream has come through by contesting for those who suffer," he added.
Malay voter turnout high, BN extends lead
7.15pm - BN has extended its lead over Pakatan Harapan by more than 1,700 votes.
According to unofficial results, BN now has 13,563 votes while Harapan has 11,833.
Independent candidate Kuan Chee Heng has 499 votes whereas PSM has 548 votes.
Malays more motivated to vote
7.10pm - The turnout rate for Malay voters is significantly higher compared to other races, according to unofficial results.
For instance, the turnout for the polling districts of Kampung Rinching, Kuala Pajam and Sesapan Batu Rembau - where nearly all the voters are Malay - saw a turnout of about 80 percent.
In all three polling districts, the vote share for Pakatan Harapan was approximately the same while BN's vote share has shot up, most likely because of support from PAS grassroots.
In contrast, the turnout for Kampung Baharu Semenyih, where 82.7 percent of the voters are Chinese, the turnout is lower at approximately 70 percent.
BN takes early lead
7pm - BN is leading Pakatan Harapan with more than 700 votes.
According to unofficial results, BN has 9,349 votes, while Harapan has 8,638 votes.
Independent candidate Kuan Chee Heng has 360 votes whereas PSM has 402.
Harapan's vote share drops in Kajang prison
6.53pm - According to the unofficial count, Pakatan Harapan's vote share in the Penjara Kajang voting district has reduced by about six percent, from 41 percent during the last general election.
BN has secured 65.35 percent of the vote, up from 41 percent previously, which is likely due to a transfer of votes from PAS supporters.
The estimated turnout for this voting district is 46 percent.
BN sweeps police vote
6.23pm - Unofficial count of the "advanced votes" and "postal votes", which are mostly by police personnel, suggests that 63.71 percent chose BN while 34.73 percent voted for Pakatan Harapan.
The estimated turnout rate for "advanced voters" and "postal votes" is 80.55 percent.
EC streams vote counting
6.10pm - The Election Commission (EC) is live streaming the vote-counting process at one of the polling stations.
EC staff have to show each ballot to the scrutineers before it is sorted.
This is likely the first time the counting process at the polling station is being shown live.
5.30pm - Polling stations are now closed.
The turnout for this by-election will likely be higher than the previous five by-elections.
According to the Election Commission's 4pm update, some 68 percent of the 54,503 voters turned up.