Malaysia's opposition leader said Tuesday a quake-tsunami that killed thousands in neighbouring Indonesia was "punishment from Allah" for the activities of gay people, sparking a storm of criticism.

Ahmad Zahid Hamidi, who heads a party which lost power in Muslim-majority Malaysia at historic elections in May, made the remarks in parliament as he warned about the growing influence of the country's gay community.

It was the latest sign of a backlash against homosexuals in Malaysia. In recent months officials - including the prime minister - have spoken out against gay rights and two lesbians were caned for breaking Islamic laws that forbid same-sex relations.

Ahmad Zahid, a former deputy former premier who is now facing jail after being arrested for corruption, said that "in Palu, where there was recently an earthquake and tsunami, it was said that there were more than 1,000 (people) involved in such (LGBTIQ+) activities.

"As a result, the whole area was crushed. This is punishment from Allah."

The 7.5-magnitude quake and subsequent tsunami smashed into the coastal city of Palu, on Sulawesi island, on September 28.

More than 2,000 bodies have since been recovered and there are fears that 5,000 more could be buried beneath the ruins in several hit-hard neighbourhoods.

Political career over

Ahmad Zahid's remarks sparked widespread criticism, and he was accused of making populist comments to save his own skin.

Pang Khee Teik, a leading gay rights activist, told AFP that the comments were "proof that every time a politician is in trouble, LGBTIQ+ people get blamed.

"Next time you hear a politician say that LGBTIQ+ people are causing natural disaster, please remember that it's because his career is about to be swallowed up by the earth."

There was a flood of anger on social media, with one Facebook user slamming Ahmad Zahid for his "stupid and irresponsible statement".

Last week the 65-year-old was hit with 45 charges in a $26 million corruption case. He is accused of crimes that include accepting bribes to award government contracts and money-laundering.