“It is going to be a full pardon which of course means that he should not only be pardoned, he should be released immediately when he is pardoned. After that he will be free to participate fully in politics.”

Mr Mahathir’s election win, at the head of the Pakatan Harapan, ended more than six decades of rule by the Barisan Nasional (BN) coalition.

Both he and Anwar were formerly in power, as part of the BN, as prime minister and deputy respectively. The story of their relationship is one of extraordinary twists and turns.

Anwar was sacked in 1998 after a dispute with the coalition leadership and then led huge protests against Mr Mahathir’s government. He was jailed a year later for abuse of power.

Then in 2000 he was convicted of sodomy, and given an additional nine-year-term.

Thought sodomy is illegal in conservative Muslim Malaysia people are seldom convicted for it, so his case was widely seen as an attempt by the government to remove a political threat.

In 2004 his conviction was overturned and he led the opposition to unprecedented gains – though not victory – in the 2008 and 2013 general elections.

Media playback is unsupported on your device

Media captionYoung voter: “We see him like a grandfather”

But that acquittal was itself overturned a year later – as he was preparing to fight a state election he seemed likely to win – and he was sent back to jail.