Mahathir sparked a social media frenzy with a show of support at a court appearance by Anwar, who was jailed again last year by Malaysia's current government following a controversial sodomy conviction, the same charge Mahathir used against him in 1998.
The brief and smiling encounter -- images were shared widely online -- underlined the current political flux in Malaysia, where opposition to scandal-tainted current Prime Minister Najib Razak has upended alliances.
Najib is accused of massive graft in the alleged looting of billions of dollars in state money. He denies the charge and has cracked down in response.
Today's meeting capped months in which Anwar and Mahathir have flirted from a distance, reviving memories of their stormy past.
The charismatic Anwar was deputy premier and heir apparent to the autocratic Mahathir until he was sacked in 1998 by his boss over political differences, an episode that continues to reverbrate.
Charged with sodomy and corruption, Anwar spent six years in jail.
But he emerged to lead the previously ineffectual political opposition to historically strong electoral showings until he was jailed again in 2015 by Najib's government.
The law, rammed through last year by Najib's government, grants Najib draconian security powers.
"I don't know about friends but I know I talked to him," Mahathir said with a chuckle when reporters asked after the encounter whether the two were friendly again.
"I met him and had a long chat with him about what he was doing."
But the encounter quickly went viral in politics-obsessed Malaysia.
"Now I think I have seen everything," Eric Paulsen of activist group Lawyers for Liberty said in tweeting an image of the handshake.
The formidable opposition alliance that Anwar forged has crumbled amid infighting, especially after his jailing.
Najib, meanwhile, has tightened his grip and used the powerful ruling coalition's deep pockets and pervasive control to win recent by-elections. The next general election must be held by mid-2018.
Disclaimer: No Business Standard Journalist was involved in creation of this content
