Millions of Malaysians voted on Sunday with one of the world's longest-serving governments under serious threat from an upstart opposition that pledges sweeping reform.
Eager voters queued at polling stations across the multi-ethnic country, but the process was marred by controversy from the start.
Voters took to the Internet in droves to accuse Prime Minister Najib Razak's government of trying to steal the election, as indelible ink that he touted as a guarantee against voter fraud was found to easily wash off.
The complaints added to other allegations of irregularities that have raised the spectre of a possible disputed result.
Polls closed at 5:00 pm (0900 GMT), with first results expected within hours.
The Election Commission estimated about 80 percent of 13 million voters -- or more than 10 million people -- turned out, which it called a record high.
The figure compared to eight million people voting in 2008. Malaysia has a total population of 28 million people.
Until Sunday, the supremacy of the ruling bloc dominated by the United Malays National Organisation (UMNO), and now led by Najib, had been unthreatened since independence in 1957.
But the diverse Pakatan Rakyat (People's Pact) opposition alliance captained by charismatic former UMNO star Anwar Ibrahim stunned the country with historic gains in 2008 polls and is gunning for a landmark victory Sunday.
"There is clearly, undeniably, a major ground swell and a major shift among the population across ethnic lines," Anwar, 65, said after he cast his ballot in a polling centre in his constituency in the northern state of Penang.
"Inshallah (God willing), we will win."
Najib's 13-party Barisan Nasional (National Front) coalition is widely given the edge, but Anwar has been feted by massive crowds on the stump and recent opinion polls have suggested a race too close to predict.
Pakatan has gained traction with pledges to end ruling-party corruption and authoritarianism, and to reform controversial affirmative-action policies for majority Malays. Anwar says they are abused by a corrupt Malay elite.
His back to the wall, Najib has offered limited political reforms but a largely stay-the-course vision for the Muslim-majority nation, while touting solid economic growth.
The ink was introduced for the first time and touted by Najib and the Election Commission -- widely viewed as Barisan-controlled -- as proving their commitment to fair polls. It is applied to a person's finger to show they have voted.
But voters like Halim Mohamad, 77, said the ink, supposed to stain the bearer for several days, washed right off.
"This is cheating. I was shocked when it came off," he told AFP after voting at the same polling centre as Anwar, showing his cleaned index finger.
"I complained to an Election Commission official and he just laughed."
The opposition had already alleged numerous irregularities including a charge that tens of thousands of "dubious" and possibly foreign voters were flown to key constituencies to sway results.
The government has said the flights were part of a voter-turnout drive but has provided no details, while Najib tweeted Sunday that no foreigners were drafted in.
"We are committed to a fair election," he said.
But videos, pictures and first-hand accounts of purportedly foreign "voters" being turned away from polling centres went viral online.
Anwar was a former deputy premier until his ouster in a 1998 power struggle and six-year jailing on sex charges widely viewed as trumped up.
He later brought his pan-racial appeal to the once-divided opposition, dramatically reversing its fortunes.
Najib has warned of chaos and racial strife under the occasionally fractious Pakatan, which includes Anwar's multi-racial party, one led by ethnic Chinese, and another representing conservative Muslim Malays.
Najib's ethnic Malay-dominated regime retains powerful advantages, including control of traditional media, key institutions and an electoral landscape critics say is biased.
"It's a tight run. But I'm not scared, I'm excited," retiree H.Y. Ong said of the race before voting in the capital Kuala Lumpur.
"The times have changed, they (the government) need to change. Money politics should be controlled," he added, while not divulging his voting preference.