KUALA LUMPUR: As Malaysia's Anwar Ibrahim prepares on Thursday to take over as prime minister following an unprecedented hung parliament, one of his recent comments serves to sum up the persistence that secured him the job he has eyed for three decades.

"This you need to learn from Anwar Ibrahim - patience, wait a long time, patience," the opposition leader told reporters outside his home a day after Saturday's election gave his progressive bloc the most seats in parliament, but not a majority.

The political uncertainty came to an end on Thursday, as Malaysia's king appointed Anwar, 75, to be prime minister.

Time and again, the job of prime minister had eluded Anwar, despite getting within striking distance over the years, first as deputy prime minister in the 1990s and later, as official prime minister-in-waiting, in 2018. 

In between, he spent nearly a decade in jail for sodomy and corruption on charges he says were politically motivated.

The most charismatic opposition leader the southeast Asian nation has ever seen, Anwar led tens of thousands of Malaysians in street protests in the 1990s against his mentor-turned-foe Mahathir Mohamad.

His strained relationship with the veteran leader shaped Anwar's own career, as well as Malaysia's political landscape, for nearly three decades.

Mahathir once called Anwar his friend and protege, and anointed him his successor. But later, amid sodomy charges and disagreements over how to handle the Asian financial crisis, he said Anwar was unfit to lead "because of his character".

The two buried the hatchet briefly in 2018 to oust from power the political alliance they once belonged to - only to fall out again within two years, ending their 22-month-old government and plunging Malaysia into a period of instability.

As opposition leader - both from jail and in parliament - Anwar slowly chipped away at the might of the Barisan Nasional alliance, Malaysia's longest ruling coalition that prioritised the interests of the majority Malays.

His rallying cry of 'reformasi', or reforms, resonated nationwide, and is still the main promise of his alliance.

That coalition is multi-ethnic and includes a party that has mainly ethnic-Chinese members and one that is unpopular with the conservative Malay majority.

For decades, Anwar has called for inclusiveness and an overhaul of the political system in the multi-ethnic country.

He called for the removal of affirmative policies favouring Malays and an end to a patronage system that had kept Barisan firmly in power until recently.

FRIEND & FOE

Anwar started off as a firebrand Islamic youth leader before joining the prime minister Mahathir's United Malays National Organisation (UMNO), which leads the Barisan Nasional alliance.

In 1993, Mahathir made Anwar his deputy, in addition to his role as finance minister. Anwar was expected to take over from Mahathir.

But they fell out after disagreeing over how to handle the Asian financial crisis. By that time, Anwar had also begun to question corruption in the Mahathir-led UMNO.

In 1998, Mahathir fired Anwar and, amid the ensuing protests, launched a crackdown on dissent. Anwar was charged with sodomy, a crime in Malaysia, in a move Anwar said aimed to put an end to his political career.

Anwar appeared at his sodomy trial with a black eye, which then became the symbol of the political party he started. Later, the police chief at the time admitted to having assaulted Anwar in prison.

"This man cannot be allowed to become a leader in a country like Malaysia," Mahathir said about Anwar at a press conference in 1998.

Anwar was freed in 2004, only to be jailed again for sodomy in 2015, two years after leading the opposition to its best electoral performance yet.

The opposition won the popular vote for the first time, despite not securing a parliamentary majority, after years of having gradually gained ground.

A LAST TRY?

In an astonishing turn of events, Anwar and Mahathir agreed to work together for the 2018 election, to oust Barisan Nasional amid widespread graft accusations against its leaders.

Barisan's Najib Razak has since been jailed in the multi-billion-dollar scandal at state fund 1MDB.

After their win, Mahathir asked for a royal pardon for Anwar and promised to hand power to him within two years.

But their coalition collapsed before that in the face of opposition to the transition, leaving Anwar out in the cold again.

He even faced calls to step down before the election as some believed he had held on for too long.

In a recent interview with Reuters, Anwar said he knew his limits, when asked if this election would be his last.

"Whether I am considered relevant or not in the next few years, that's for the people to decide," he said.

With the people's vote and the king's choice, he finally became prime minister.