After decades of waiting in the wings, Anwar Ibrahim has been appointed Malaysia's prime minister.
His appointment is the result of a decades-long political journey that saw him almost elected to the job - not once, but twice.
He was imprisoned for years under the leadership of political titan Mahathir Mohamad, who was also Mr Anwar's one-time mentor.
The rollercoaster relationship between the two men would come to define not only Mr Anwar's fortunes, but also Malaysian politics - and Mr Anwar's place in it.
Mr Anwar, now 75, first made his name as a charismatic firebrand student leader who founded Malaysia's Islamic youth movement, ABIM.
He surprised many by joining the United Malays National Organisation (UMNO), the long-ruling party, in 1982.
But it proved a canny political move - he climbed rapidly up the political ladder and held multiple ministerial posts.
In 1993 he became Mr Mahathir's deputy and was widely expected to succeed him. But tensions set in after the Asian financial crisis of 1997, as they clashed over the economy and corruption.
In September 1998, Mr Anwar was sacked and led public protests against Mr Mahathir. It was the start of Reformasi, a reform movement that would influence a generation of Malaysian democracy activists.
Mr Anwar was arrested and eventually charged with sodomy and corruption - charges he denied in the controversial trial that followed.
While Muslim-majority Malaysia criminalises homosexual activity, convictions are rare and the case against Mr Anwar was internationally condemned as politically motivated.
Violent street protests erupted when he was jailed for six years for corruption. A year later he was sentenced to nine years for sodomy.
Mr Anwar has always maintained the charges were part of a smear campaign to remove him as a political threat to Mr Mahathir.
In late 2004, a year after Mr Mahathir stepped down as premier, Malaysia's Supreme Court overturned the sodomy conviction and freed Mr Anwar from jail.
A growing opposition, new charges
Upon his release, he emerged as the de facto head of a newly invigorated opposition that registered a strong showing in the 2008 elections.
But claims of sodomy were again made against Mr Anwar in 2008, in what he said was another attempt by the government to sideline him.
A High Court eventually cleared Mr Anwar of the charges in January 2012, citing a lack of evidence.
The following year he led the opposition to new heights in an election that delivered what was then the worst-ever showing for the ruling Barisan Nasional coalition.
But once again Mr Anwar's ambitions were thwarted. As he was preparing to fight a state election in 2014, his earlier acquittal was overturned and he was sent back to jail.
In a shock turn of events in 2016, his former rival Mr Mahathir announced he was coming out of retirement to run for top office again.
The then 92-year-old said he was sick of the corruption allegations plaguing the then prime minister - another former protégé, Najib Razak.
But to stage his comeback Mr Mahathir struck an unlikely deal with the still imprisoned Mr Anwar, who had remained hugely popular with opposition supporters.
In a much publicised moment the two exchanged a once unthinkable handshake, marking the start of an extraordinary political reunion.
Mr Mahathir led the Pakatan Harapan alliance to victory in 2018's landmark elections, ending Barisan Nasional's unbroken 61-year streak in ruling the country.
The new Pakatan Harapan coalition welded together four parties into Malaysia's first truly multi-ethnic coalition that commanded support among the Malay Muslim majority as well as the country's sizeable Chinese and Indian minorities.
As Malaysia's prime minister once again, Mr Mahathir met his pledge to free Mr Anwar from prison, initiating a full pardon. He also indicated he would hand power to Mr Anwar within two years.
But the alliance began to look precarious as the nonagenarian kept shifting the goalposts for handing over power. It began to unravel amid bitter infighting over succession and a resurgence of Malay nationalism.
In February 2020, Mr Mahathir's unexpected resignation led to the coalition's collapse, plunging Malaysia into an unprecedented period of political turmoil - and leaving Mr Anwar empty-handed once again.
After the new government crumbled, UMNO was brought back into power and Muhyiddin Yassin was named the new prime minister.
But just over a year later at the peak of the pandemic, Mr Muhyiddin resigned after a tumultuous few months that saw him lose his majority support in parliament.
In October 2022 his successor, UMNO's Ismail Sabri Yaakob, announced snap elections - UMNO was convinced by a string of by-election wins that they could regain power.
Instead, Mr Anwar's Pakatan Harapan alliance emerged with the most seats, although still short of a simple majority needed to form a government, and after days of deadlock the country's king announced Mr Anwar's appointment - the culmination of a 25-year-long wait.
But the road ahead is still one that will be filled with challenges for Mr Anwar, who must knit together a workable governing coalition - and will undoubtedly face difficulties in his promotion of a more pluralistic, inclusive Malaysia, in the face of rising Islamism.