Najib Razak, Malaysia PM
Malaysian Prime Minister Najib Razak and other party leaders celebrate after winning the elections at Barisan Nasional headquarters in Kuala Lumpur Sunday night, May 5, 2013. Reuters

Malaysia’s National Front coalition has won Sunday's election, extending its 56-year rule, with two-thirds of seats confirmed.

Prime Minister Najib Razak's Barisan Nasional passed the threshold of 112 seats in the 222-seat parliament, the Election Commission said early Monday morning, according to a BBC report.

But defeated opposition leader Anwar Ibrahim accused the ruling party of widespread fraud before and during the polls.

The voter turnout was 80 percent, said election officials.

Voters had been faced with returning the ruling party, or choosing Anwar's untested three-party alliance, Pakatan Rakyat.

As the result was confirmed, Najib, 59, urged all Malaysians to accept his victory.

"We have to show to the world that we are a mature democracy," he said in a televised broadcast.

At 1 a.m. Monday, Barisan Nasional said it had won 117 seats to Pakatan Rakyat's 65.

Earlier, Najib had said he was confident Malaysians would retain his coalition and even return the two-thirds parliamentary majority it lost in the 2008 election.

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

In what was considered a tight race, it had campaigned hard to shore up its base among poorer ethnic Malay neighborhoods and in rural areas.

The opposition retained economically important Penang state as Anwar sought to build on stunning gains in 2008, when it took over four state governments and deprived the BN of its two-thirds parliamentary majority. It also claimed to have retained the crucial industrial state of Selangor, which Najib had vowed to win back, although that could not be confirmed with election officials.

Anwar refused to concede defeat, accusing the authorities of widespread abuses which he said had distorted the result of the election

"It is an election that we consider fraudulent and the Electoral Commission has failed," he told a press conference after midnight on Monday.

Before most votes were counted, Anwar declared victory in a surprise statement that appeared to be a tactic to whip up support, Reuters reported.

"PR has won," Anwar wrote on his Twitter account, urging the ruling party and the Election Commission "not to attempt to hijack the results."

Allegations of election fraud surfaced before the election. Some of those who voted in advance told BBC News that indelible ink on their hands - supposed to last for days and show they had already voted - had easily washed off.

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

An independent pollster, the Merdeka Center, also cited unconfirmed reports of foreign nationals being given ID documents and allowed to vote.