Media playback is unsupported on your device Media caption Jonathan Head reports from a polling station queue in Kuala Lumpur, where he says turnout was "very impressive", driven by a "real hunger" for change

There has been a record turnout in what is widely expected to be the most closely contested general election in Malaysia's history.

Some 80% of registered voters cast ballots, said election officials.

PM Najib Razak's Barisan Nasional (National Front) coalition is up against Pakatan Rakyat, a three-party alliance headed by Anwar Ibrahim.

Voters were faced with returning the ruling party, in power for 56 years, or choosing an untested opposition.

Ahead of the polls, allegations of various forms of fraud emerged.

Early results showed Barisan Nasional had won 38 parliamentary seats to Pakatan Rakyat's 16, with at least 112 of 222 parliamentary seats being needed to win federal power. Final results are not expected until Monday.

'People do change'

We hope for a change of government Karunamoorthy, Malaysian voter

At polling stations in Kuala Lumpur on Sunday, there was a palpable sense of excitement among the many voters there who support the opposition coalition, says BBC's Jonathan Head in the Malaysian capital.

Some said this was the first time they felt their votes had mattered.

But Barisan Nasional has been campaigning very hard to shore up its base among poorer ethnic Malay neighbourhoods and in rural areas, and opinion polls suggest a very close race.

Barisan Nasional, while credited with bringing economic development and political stability, has also been tainted by allegations of corruption.

But it remains to be seen whether Mr Anwar's coalition, comprising parties of different ethnicities and religions, can persuade voters to choose an alternative government.

Mr Najib, 59, said he was confident that Malaysians would retain his coalition and even return the two-thirds parliamentary majority Barisan Nasional lost in the 2008 polls.

Image copyright Getty Images Image caption Najib Razak voted in Pekan

During the last four years, he said during a campaign rally on Thursday, the coalition had proved it could "protect and benefit all Malaysians".

"The task of transformation is not over yet," he told supporters in his home state of Pahang on Saturday.

Mohamed Rafiq Idris, a car business owner waiting to vote in the central state of Selangor, told the Associated Press news agency the ruling coalition had made "some mistakes" but he believed it would do its best to take care of the people's welfare.

But first-time voter Bernie Lim, a banker, said: "I grew up recognising that my parents voted for the present coalition at almost every general election. This time, they voted for the opposition. People do change."

Ethnic Indian voter Karunamoorthy told BBC News in the capital: "We hope for a change of government. There needs to be a change because of abuse of power."

Mr Anwar, 65, has said people's clamour for change means that Pakatan Rakyat will emerge victorious.

Malaysia 2013 polls Election was considered Malaysia's most keenly contested poll since independence

PM Najib Razak leads the long-dominant coalition Barisan Nasional (National Front)

Anwar Ibrahim leads the three-party opposition coalition Pakatan Rakyat

Key issues include corruption, race-based policies that favour Malays and the economy

Turnout was estimated at a record 80%, election officials said Q&A: Malaysia elections Profile: Najib Razak Profile: Anwar Ibrahim

"People have enough of this semi-authoritarian rule, of complete [government] control of the media, of strong arrogance, of power and endemic corruption," he told AP in an interview.

He advised supporters "to remain calm, not to be provoked, not to take the law into their own hands, support the process".

"Unless there's a major massive fraud tomorrow - that is our nightmare - we will win," he told AFP news agency.

Online drive

Allegations of election fraud surfaced before the election. Some of those who voted in advance told BBC News that indelible ink - supposed to last for days - easily washed off.

"The indelible ink can be washed off easily, with just water, in a few seconds," one voter, Lo, told BBC News from Skudai.

Image copyright AP Image caption Anwar Ibrahim voted in Penang state

Another voter wrote: "Marked with "indelible ink" and voted at 10:00. Have already cleaned off the ink by 12:00. If I was also registered under a different name and ID number at a neighbouring constituency, I would be able to vote again before 17:00!"

The opposition has also accused the government of funding flights for supporters to key states, which the government denies.

Independent pollster Merdeka Center has received unconfirmed reports of foreign nationals being given IDs and allowed to vote.

The international organisation Human Rights Watch said there had been well-planned attacks against the country's independent media ahead of the polls.

Both sides actively engaged the electorate online, especially the country's 2.6 million new voters, the BBC's Jennifer Pak reports from Kuala Lumpur.

Visiting the social media unit for PKR, one of the opposition parties, she found activists posting messages to encourage people to vote despite heavy rain in some regions.

Image caption PKR social media activists reported an attacks on their Facebook page

Most traditional media in Malaysia are linked to the governing parties so opposition parties rely almost exclusively on the internet to get their message out, she says.

"This is our only way to get our message out but, even then, we do struggle," said activist Praba Ganesan. "Our Facebook account this morning was attacked, we had to remove content, we had to fix it. There are fears that things are being compromised."

Officially, just 18 foreign electoral observers are in Malaysia. They are joined by 1,200 local observers from 17 non-governmental organisations.

The electoral commission said on Saturday that the foreign observers comprised six each from Indonesia and Thailand, and two each from Burma, Cambodia and the Asean secretariat.