MALAYSIA’S former authoritarian ruler, Mahathir Mohamad, has capped a stunning political comeback at the age of 92 by leading opposition parties to their first election victory in six decades.

Mahathir won a clear mandate to form a government and insisted he should be immediately confirmed as prime minister.

In a lively Kuala Lumpur news conference peppered with swearing and trademark wisecracks, Mahathir flagged significant changes for Malaysia, which he described as being left in a “mess” by defeated prime minister Najib Razak’s National Front coalition.

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.

The election result has shaken the Muslim-majority country, ending the National Front’s unbroken 60-year rule and sweeping aside Najib, whose reputation was tarnished by a corruption scandal, a crackdown on dissent and an unpopular sales tax which hurt many of his coalition’s poor rural supporters.

Mahathir said: “We need to have this government today without delay. 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. So we expect that today, well, I’ll be sworn in as prime minister.”

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

Angered by a national scandal at state investment fund 1MDB, Mahathir emerged from political exile and joined the opposition to oust Najib, his former protege.