Malaysia’s former authoritarian leader Mahathir Mohamad has been sworn in as prime minister at the age of 92, cementing a historic change of government.

Mr Mahathir staged a stunning political comeback, leading opposition parties to their first election victory in six decades.

The ceremony before Malaysia’s king at the official state palace in Kuala Lumpur ended a day of uncertainty during which rumours swirled that the National Front, Malaysia’s perennial ruling party, would try to stay in power.

People waiting outside the palace cheered, waved opposition flags and sounded car horns.

A campaign poster of Mahathir Mohamad is displayed on a street in Kuala Lumpur (Aaron Favila/AP)A campaign poster of Mahathir Mohamad is displayed on a street in Kuala Lumpur (Aaron Favila/AP)

The election result is a political earthquake for the Muslim-majority country, sweeping aside the 60-year rule of the National Front and its leader Najib Razak, whose reputation was tarnished by a monumental corruption scandal, a crackdown on dissent and the imposition of an unpopular sales tax that hurt many of his coalition’s poor rural supporters.

It was also a surprising exception to backsliding on democratic values in South East Asia, a region of more than 600 million people where governments of countries including Thailand, Cambodia and the Philippines have swung towards harsh authoritarian rule.

Amnesty International said Malaysia’s first-ever change in government is an opportunity to “eradicate repressive policies” and put human rights first.

“We need to have this government today without delay,” Mr Mahathir said before the ceremony.

“There is a lot of work to be done. You know the mess the country is in and we need to attend to this mess as soon as possible and that means today.”

Oldest elected leaders(PA Graphics)

After the result of the election became clear early on Thursday, supporters of the incoming government took to the streets of Kuala Lumpur to celebrate their unexpected victory.

Many analysts had thought the National Front might lose the popular vote but cling to a majority in parliament due to an electoral system that gave more power to its rural Malay supporters.

People stood on roadsides waving the white, blue and red flag of the opposition alliance that triumphed in Wednesday’s election. Cars honked their horns as they sped past.

“I’m so happy,” said Zarini Najibuddin, while waving the opposition flag. “I hope we’ll have a better Malaysia now. Malaysia reborn!”

Ibrahim Suffian, co-founder of the Merdeka Centre for Opinion Research, said the new government will have to contend with “enormous forces of inertia and resistance from within the government elites”.

“The bureaucracy and the rest of the government apparatus has never been used to this idea, having been, you know, more than 60 years under the same political party,” he said.

Mr Mahathir, prime minister for 22 years until stepping down in 2003, was credited with modernising Malaysia but was also known as a heavy-handed leader who imprisoned opponents and subjugated the courts.

People at a restaurant watch as Mahathir Mohamad is sworn in (Aaron Favila/AP)People at a restaurant watch as Mahathir Mohamad is sworn in (Aaron Favila/AP)

Angered by the corruption scandal at state investment fund 1MDB, Mr Mahathir emerged from political retirement and joined the opposition in an attempt to oust Mr Najib, his former protege.

The US Justice Department said 4.5 billion dollars was looted from 1MBD by associates of Mr Najib between 2009 and 2014, including 700 million dollars that landed in Mr Najib’s bank account and a 23 million dollar pink diamond necklace bought for his wife.

He has denied wrongdoing.

Mr Mahathir said the new government will not conduct a witch-hunt, but Mr Najib will have to face the consequences if he has broken the law.

Mr Najib, 64, said he accepted the “verdict of the people”.

The National Front “will honour the principle of democracy in the parliament”, he said.