PM Mahathir Mohamad appeared at a rally in support of his designated successor and former foe Anwar Ibrahim

It was almost as though two decades of mudslinging, false accusations and jail sentences had never happened.

Appearing at a political rally together for the first time in 20 years, Malaysian prime minister Mahathir Mohamad and his former protege-turned rival Anwar Ibrahim demonstrated they had set aside their bitter political feud once and for all- and even declared their love for each other.

“I love him as a father and as a leader,” said Anwar, gesturing to Mahathir who made a surprise appearance in Port Dickson on Monday to pledge his support for Anwar’s return to politics in a by-election in the seaside town on Sunday.

Malaysia’s Anwar Ibrahim: ‘When it is denied to you, freedom is a torture’ Read more

“I fought against him and now I accept that he is the best man to lead Malaysia now.”

It was a scenario that even a year ago many would have believed impossible. When Mahathir, who was re-elected in May, was prime minister the first time between 1981 and 2003, Anwar was his protege, eventually rising to become deputy prime minister.

But in 1998, the pair had a bitter and very public falling out and Mahathir began to fear Anwar’s vast popularity. Anwar was ousted from office and then found himself charged with sodomy and corruption.

The resulting court case, the longest in Malaysian history, saw Anwar found guilty corruption and sodomy, landing him with a cumulative 15-year prison sentence. He was released from prison in 2004 but in 2015 he was convicted again of sodomy — charges he said were again concocted to destroy his political career.

Until late last year, even while Anwar remained in jail, the relationship between Mahathir and Anwar was publicly vitriolic. But in January, in his determination to oust former prime minister Najib Razak from power due to multiple corruption allegations, Mahathir extended an olive branch to Anwar.

The pair formed an unexpected new political alliance, with Mahathir agreeing that if he won the election, with the backing of Anwar, he would have Anwar pardoned, released from jail, and then make way for him to become prime minister in two years.

Since the 93-year-old Mahathir led the Pakatan Harapan coalition to a shock victory on May 9, giving Malaysia its first opposition government since independence, all eyes have been on Mahathir to see whether he would honour his agreement with Anwar.

So far he has overseen the pardon and immediate release of Anwar from jail, but the ultimate test of their renewed alliance will be Anwar’s return to politics, and his possible elevation into the cabinet if he wins the by-election on Sunday, which is being held in the constituency of Port Dickson.

“I am happy to be able to campaign for Anwar today,” said Mahathir, in his speech to a crowd of thousands on Monday.

“I hope that in this by-election, victory will be given to the Alliance of Hope, to Anwar. I hope that we can continue to work together ... not for Mahathir or Anwar but for our beloved country.”

Anwar faces six other candidates but is expected to win Sunday’s parliamentary by-election easily. However, the by-election, which was triggered solely so that Anwar could run for a parliamentary seat, has stirred up some anger in Malaysia, with some declaring Anwar is being given “undemocratic” preferential treatment.

Questions also remain over whether, if he wins the Port Dickson seat and is quickly elevated into the cabinet as many expect, his wife Wan Azizah, who is currently deputy prime minister, will step down as she had pledged to do in the past.