Kuala Lumpur (AFP) – Malaysia’s parliament repealed a controversial law on Thursday that punished spreading “fake news” with up to six years in jail and which critics said was aimed at stifling dissent.

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

Political opponents said the law 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.

As well as hefty jail terms, the legislation punished the dissemination of what authorities deemed fake news with a fine of up to 500,000 ringgit ($120,000).

However, Najib and his long-ruling coalition unexpectedly lost power at the landmark elections in May, bringing to power a reformist alliance which had campaigned on a pledge to abolish the law.

Making good on that promise, lawmakers voted in favour of repealing the fake news law on Thursday after a three-hour debate.

Charles Santiago, an MP from the ruling Pact of Hope coalition, told AFP the move was part of the new government’s “commitment to take away all legislation that impinges on human rights and freedom of expression”.

Teddy Baguilat, a member of a Southeast Asian grouping of MPs who fight for better human rights, praised the move as “a huge step forward.

“This is a law that was clearly designed to silence criticism of the authorities and to quell public debate — it should never have been allowed to pass in the first place.”

Prime Minister Mahathir Mohamad, who ousted Najib at the 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.