Malaysian lawmakers voted to repeal a controversial law Wednesday that punished spreading "fake news" with up to six years behind bars and which critics said was aimed at stifling dissent.

As well as hefty jail terms, under the legislation those who disseminated what authorities deemed false news -- via any medium, from print to social networks -- could be fined up to 500,000 ringgit ($120,000).

It was the second attempt by the lower house to overturn the law after MPs voted to repeal it last year only for the opposition-controlled upper chamber to block it.

But the upper house is only able to block a bill once, meaning it should still now be repealed even if lawmakers there vote it down again.

The legislation was pushed through last year by the former, scandal-tainted regime in the run-up to a hotly contested general election, sparking a storm of anger.

Political opponents said it was a crude tool aimed at silencing criticism of the then-government and its leader Najib Razak, particularly over the corruption mega-scandal surrounding sovereign wealth fund 1MDB.

However Najib and his long-ruling coalition unexpectedly lost the landmark 2018 elections that brought to power a reformist alliance which had pledged to abolish the law.

Charles Santiago, an MP from the ruling Pact of Hope coalition, welcomed Wednesday's move which came after two days of debate.

He told AFP the legislation had been aimed at helping "cover up the former government's abuse and corruption".

Prime Minister Mahathir Mohamad, who ousted Najib at last year's polls, was investigated for allegedly spreading fake news days ahead of the election. He was an opposition leader at the time.

Malaysia is one of several countries in Asia that have turned to such legislation, emboldened by US President Donald Trump's fulminations against "fake news", but activists warn authoritarian regimes will use the laws to target opponents.

Last week, a law to combat fake news came into effect in Singapore despite criticism from tech giants and activists.