Malaysia's ruling coalition has retained its 56-year hold on power in hard-fought elections but opposition leader Anwar Ibrahim says the victory is tainted and has refused to concede.

The Barisan Nasional (National Front) coalition led by Prime Minister Najib Razak got well past the threshold of 112 seats for a simple majority in parliament, standing on 133 as final returns continued to trickle in early on Monday.

Najib, 59, called for a spirit of "reconciliation" after Sunday's elections, which saw record voter turnout and were preceded by a fierce campaign that laid bare deep polarisation in the country.

"For the sake of national interest, I ask all parties, especially the opposition, to accept this result with an open heart," Najib said.

"Overall, the results show a trend of polarisation which worries the government. If it is not addressed, it can create tension or division in the country."

But Anwar, whose three-party Pakatan Rakyat (People's Pact) alliance had hoped to pull off a stunning win against the only government Malaysia has known, was in no mood to concede.

"It is an election that we consider fraudulent and the EC (Election Commission) has failed," an exhausted-looking Anwar said after the announced returns dashed early hopes among his supporters that victory was at hand.

Among irregularities alleged by the opposition, Anwar has said tens of thousands of "dubious" and possibly foreign voters were flown to key constituencies to sway results.

The government denies the charge.

Legal avenues

Opposition officials said Pakatan Rakyat would explore possible legal avenues over such allegations, but the poll result is likely to stand as court challenges that threaten the government's hold rarely gain traction.

The EC said a record 80 percent of the multi-ethnic country's 13 million registered voters - or more than 10 million people - had turned out on Sunday.

Voters took to the internet in droves to accuse Najib'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.

Social media websites have been abuzz with videos showing foreign nationals receiving citizenship through dubious means and then being transported into voting centres to vote, Al Jazeera's Florence Looi reported from Kuala Lumpur.

Videos, pictures and first-hand accounts of purportedly foreign "voters" being confronted at polling centres by angry citizens also went viral online.

Police have banned all victory parades and street demonstrations after the declaration of the results.

Najib had been under pressure from conservatives in his United Malays National Organisation (UMNO), Barisan Nasional's dominant force, to regain seats lost in 2008 polls when Pakatan Rakyat stunned the ruling bloc with its worst setback ever.

There have been warnings that he could face a leadership challenge within UMNO if he fell short.

Najib appears to have failed to improve, but did not lose significant ground in parliament, and Barisan Nasional gained back one of four states held by the opposition. Malaysia has 13 states.

Najib also has been squeezed by rising public pressure for reform, to which he has responded with some limited liberalisation moves.

He had called for voters to give him his first mandate - Najib was installed in 2009 when his predecessor was dumped over the 2008 result - so that he could continue his reform agenda.

Career at a crossroads

The election outcome raises the spectre of an end to the charismatic Anwar's remarkable career, after he earlier pledged to step aside as opposition leader if he failed to win the long-awaited election.

Anwar, 65, was deputy prime minister until his overthrow in a 1998 power struggle with then-Prime Minister Mahathir Mohamad and jailing for six years on sex charges widely viewed as trumped up, events that deeply polarised Malaysian politics.

Anwar later brought his pan-racial appeal to the once-divided opposition, dramatically reversing its fortunes.

After leading Pakatan Rakyat to historic gains in 2008 polls in which it denied Barisan Nasional its powerful two-thirds majority for the first time ever, Anwar had aimed to topple the government on Sunday.

Pakatan Rakyat campaigned against corruption and pledged to roll back a decades old quota system that favours ethnic Malays in schools, business contracts and civil service jobs.

But ethnic Malay-dominated Barisan Nasional retained powerful advantages, including control of traditional media, key institutions and an electoral landscape which critics say is biased in its favour.

Follow Al Jazeera's correspondents reporting from Malaysia: Charles McDermid (@charlesmcdermid), Kate Mayberry (@kate_mayberry), Scott Heidler (@scottheidler) and Florence Looi (@florencelooi)