KUALA LUMPUR: For years, charges have swirled that a secret Malaysian scheme gave citizenship to huge numbers of illegal migrants in a politically important state in exchange for votes for the ruling coalition.

Now, an inquiry is finally airing detailed allegations that have the government on the defensive ahead of elections that pose the greatest threat yet faced by the ruling bloc that has controlled Malaysia for 56 years.

A Royal Commission of Inquiry opened last week with ex-officials admitting they gave citizenship to Filipinos and Indonesians in resource-rich Sabah, one of two Malaysian states on Borneo island.

One former official said some 100,000 identity cards (ICs) were handed out in 1993 ahead of a crucial state election, Malaysian news reports said. Another admitted signing hundreds of thousands of ICs in the 1990s.

The testimony has revived accusations of treason against former prime minister Mahathir Mohamad, who is alleged to have masterminded the scheme to shore up support for his government.

As head of the ruling Barisan Nasional (BN) coalition, Mahathir dominated Malaysia for 22 years until he resigned in 2003.

Current prime minister Najib Razak is now battling to rally support for the BN ahead of polls he is expected to call within months, in an era when the coalition's power grip has slipped.

But outrage over "Project IC", as the alleged scheme is widely known, is undercutting his claims that the national electoral roll is free of fraud.

The opposition and election-reform advocates allege massive fraud in voter rolls nationwide and have seized on the testimony as proof of government vote-tampering.

"What we are concerned about is that this is still going on. That's what we want to stop," Ambiga Sreenevasan, head of the clean-elections activist coalition known as "Bersih", or "Clean", told a press conference on Tuesday.

The outlines of "Project IC" have been whispered about for three decades and have bolstered the view of Sabah as a reliable "fixed deposit" of votes for the BN to help it weather challenges elsewhere.

The government allegedly targeted Muslims from neighbouring Indonesia and the predominantly Muslim southern Philippines.

More than half of Malaysia's 29 million people are Muslim ethnic Malays, but indigenous tribes, many of them Christian, predominate in Sabah.

They have bridled at the foreigners, blaming them for crime, drug abuse and economic competition, and alleging their homeland was being stolen.

Najib last June gave in to calls for an inquiry, but the move could backfire, said Ibrahim Suffian, head of independent polling firm Merdeka Centre, calling the revelations "explosive".

"It probably will create a wave of resentment and dissatisfaction among native Sabah voters. This confirms their worst fears," he said.

The population of Sabah, a region of rugged mountains and powerful rainforest rivers that is about the size of Ireland, has surged from some 600,000 citizens in 1970 to more than three million -- more than double the national growth rate.

Malaysia's opposition alleges some 700,000 may have illegally received ICs. A one-time battleground state, Sabah has been pro-BN since the mid-1990s.

The once all-powerful BN suffered a shock setback in 2008 national elections, and analysts predict a close fight with a formidable opposition led by Anwar Ibrahim, a former deputy premier, raising fears that government fraud could play a role.

Najib insists the national electoral system is clean and has highlighted recent reforms such as plans to use indelible ink to prevent multiple voting.

"Let the commission do its work and find out," Najib was quoted as saying by state media, warning against a rush to judgement in Sabah.

Mahathir, still a vocal and influential conservative figure, has denied the existence of "Project IC," but admitted at a press conference last week that foreigners in Sabah were given citizenship, saying no laws were broken.

No one has yet directly implicated him before the commission, but witnesses said last week they were directed by officials close to Mahathir. There has been no testimony yet suggesting "Project IC" was still active.

Hearings will continue for weeks, with some 170 witnesses expected to testify. The commission has until late March to investigate.

The commission's final recommendations are not legally binding, but could lead to pressure for a crackdown on illegals.