It has been a bumpy road to the pinnacle of power for Anwar Ibrahim, who on Thursday achieved his dream of the Malaysian premiership.
In his decades-long quest for the top job, the 75-year-old has tasted political triumph and defeat, led street protests for democratic reforms and strung together a multi-ethnic opposition coalition while behind bars.
He was named prime minister by Malaysia's king after days of political deadlock resulting from an inconclusive election.
Anwar was born into a political family in August 1947.
His father, Ibrahim Abdul Rahman, was a former member of parliament and his mother, Che Yan Hussein, was a political organiser in the northern state of Penang, in what was then part of the British empire.
PAY ATTENTION: Subscribe to Digital Talk newsletter to receive must-know business stories and succeed BIG!
A firebrand youth activist during his student days, Anwar has spoken of his admiration for Philippine revolutionary hero Jose Rizal, describing him as "a true Asian renaissance man".
In 1982, Anwar was recruited into the United Malays National Organisation (UMNO), the party then in the middle of its 60-year domination of Malaysian politics.
His star rose, and the suave young politician became finance minister and then deputy prime minister in the early 1990s under then-premier Mahathir Mohamad, bringing a youthful counterbalance to the wily political veteran.
They were considered one of the most dynamic duos in Southeast Asian politics, but their relationship soured over how to handle the 1997-98 Asian financial crisis.
Some observers say Anwar had been too impatient to become prime minister, slighting his patron.
Mahathir sacked Anwar, who was also expelled from UMNO and charged with corruption and sodomy.
He was sentenced to six years in jail for corruption in 1999, with a nine-year prison term added for the sodomy charge the following year, the two sentences to run consecutively.
As Anwar claimed political persecution, street protests erupted and coalesced into a multi-ethnic opposition movement calling for democratic reforms.
Photos of Anwar with a black eye, inflicted in prison by Malaysia's then-police chief, were published in newspapers around the world, turning him into a symbol for a struggle that adopted the battle cry of "Reformasi!", or reforms.
Despair and hope
The Malaysian Supreme Court overturned Anwar's sodomy conviction in 2004 and ordered him freed.
He took a brief hiatus from politics to go into academia, but returned to lead an opposition coalition in the 2013 general election.
His alliance won 50.87 percent of the popular vote but failed to muster a parliamentary majority.
Controversy continued to hound the married father of six.
He was again jailed for sodomy in 2015, this time for five years.
He has maintained his innocence and received a full pardon from the Malaysian king three years into his sentence. Anwar returned to parliament months later in a by-election.
The 2018 election brought a new alliance with his erstwhile rival Mahathir, the pair making an unlikely reunion to take on their former party UMNO, led by prime minister Najib Razak, then mired in the billion-dollar 1MDB financial scandal.
They scored a historic victory against UMNO and Najib, who is now serving a 12-year jail term for corruption.
Mahathir became prime minister for the second time, with an agreement to hand over the premiership to Anwar later.
He never fulfilled that pact, and their alliance collapsed after 22 months.
"I sense the people's strong desire for change and to see Malaysia progress in a new direction," Anwar said before last week's polls.
After his swearing-in Thursday, Anwar will finally get to set that direction.