Mahathir Mohamad: Malaysian political survivor
At the age of 92, Mahathir Mohamad is set to become Malaysia's prime minister again.
He retired from the post in 2003, after 22 years at its helm. But came out of retirement to correct what he called "the biggest mistake in my life" - the elevation of incumbent leader Najib Razak to power.
Having fallen out with Mr Najib as well as the ruling United Malays National Organisation (UMNO) party, he is now leading his long-time foes, the opposition Pakatan Harapan coalition, into battle.
Prior to the election, he said he intended to be prime minister for two years, before handing over to the coalition's currently jailed leader, Anwar Ibrahim.
No spoonfuls of sugar
Mr Mahathir's political drive and combative spirit for what many view as the near-impossible task of toppling the ruling coalition is no surprise to Malaysians.
Mr Mahathir joined UMNO at the age of 21 and ran a medical practice for seven years in his home state of Kedah before becoming a member of parliament in 1964.
In 1969 he lost his seat and was expelled from the party after writing an open letter attacking the then Prime Minister Tunku Abdul Rahman.
He later wrote a controversial book entitled The Malay Dilemma. In it, he argued that the country's Malay population had been marginalised, but also castigated them for apathetically accepting a second-class status.
It struck a chord with younger UMNO leaders and he was invited back into the party, re-elected to parliament in 1974, and appointed minister of education. Within four years he had become UMNO's deputy leader and, in 1981, he became prime minister.
- A 92-year-old politician's big comeback?
- Malaysia's youth have power they won't use
- Politics and Malaysia's multi-racial voters
Under his rule, Malaysia transformed into one of the Asian economic tigers of the 1990s - prestige projects such as the Petronas Twin Towers demonstrated the extent of his ambitions.
His authoritarian but pragmatic policies won him popular support at home, though this was tempered by his scant regard for human rights.
Black eye for democracy
Opposition politicians were jailed without trial under a much-criticised Internal Security Act.
Most infamously, his deputy prime minister, Anwar Ibrahim, was sacked, accused of corruption and sodomy and later jailed on the latter charge, when he called for economic and political reforms in 1998.
Frequent barbed comments about the West also earned Mr Mahathir a reputation abroad. Days before he resigned in October 2003, for example, he angered several foreign governments and Jewish groups by claiming a Jewish cabal "ruled the world".
He said he left his post "disappointed... because I have achieved too little in my principal task of making my race a successful race, a race that is respected".
Even in retirement, he never really left the political arena.
He publicly criticised his successor Abdullah Badawi and, after lacklustre election results for the ruling coalition in 2008, quit the party in what many saw as a way to pressure Mr Abdullah to go.
That paved the way for Mr Najib to come to power.
Mr Mahathir's initial support for Mr Najib changed, however, as accusations of corruption against him surfaced in regard to a heavily indebted state investment fund called 1Malaysia Development Berhad (1MDB).
- US looks to seize $540m in 'stolen' assets from Malaysia fund 1MDB
- 1MDB: The case that has riveted Malaysia
- Malaysian artist jailed for mocking Prime Minister Najib Razak
He commanded enough loyalty from supporters within UMNO to press the case against Mr Najib from within the party and government.
When they got nowhere, however, he, and several high-profile supporters quit UMNO and crossed over to the opposition in 2016.
In January this year, he announced his intention to contest the election, at the age of 92.
On 9 May, he won a historic victory, ousting his former allies after more than 60 years in power.
Does the doctor know best?
To the surprise of many, he has admitted he was wrong on many things and apologised for them - not least for sacking Anwar Ibrahim.
Mr Najib has criticised Mr Mahathir's new political allegiance, calling him Malaysia's "number one actor" for making up with Mr Anwar and saying "I had to shake my head in disbelief seeing his antics."
Mr Abdullah, in a book about his time in power, has said of him: "Mahathir is set in his ways. And he believes that his way is the only way."