Two years ago, Mahathir Mohamad, the former prime minister of Malaysia, visited Hong Kong. At the time, the Umbrella Movement was in full swing. Mahathir had been invited to address a pro-establishment gathering of political figures and business elites at the convention centre in Wan Chai. Few in the audience seemed to know much about Malaysia. But they knew about Mahathir. And in appreciating the managerial fist that he had wielded during his long tenure, they paid high fees to come and take heart.

Mahathir didn’t disappoint. Though 90 years old, he held the floor for an hour, without notes or nary a stumble. His central theme was that mainland China, in contrast to the meddlesome West, was beneficent and nobly intentioned, with Malaysia uplifted by its investment. The audience nodded on in agreement. But what they really wanted to learn from Mahathir was how to stamp out the Umbrella Movement.

With a handshake and smile, Malaysia’s old foes Mahathir and Anwar meet for the first time in 18 years

So, during the Q&A, local notables clamoured for the mike. A loyalist member of Legco implored, “Can you give us some of your precious advice?” Mahathir pursed his lips, then sagely intoned, “the best way to handle it is to handle it before the occupying” – intimating that Hong Kong’s police had been tardy and soft. At this, Mahathir was thunderously applauded. A Malaysian guest at my side thumped the table top. “I’d like to bring the Malaysian police in here,” he growled. “They’d teach these kids something.”

Today Mahathir remains an opinion leader in Malaysia. But he is now dispensing different advice. While prime minister, Mahathir regularly ordered the arrest of opposition leaders and activists whom he accused of wanting to “topple the government” – a record that his Hong Kong audience warmly recalled. But now in opposition himself, Mahathir courts his own arrest while trying to topple the government of the current prime minister, Najib Razak.

Mahathir loudly demands that Najib resign, citing the money laundering scandal over Malaysia’s sovereign wealth fund 1MDB. He has quit the party that Najib leads, the United Malays National Organisation (Umno). He has applied to register a new opposition vehicle. And he is the patron of the Citizens’ Declaration and the Save Malaysia Movement, a broad social coalition that through rallies, town hall meetings and a nationwide signature campaign, is pressuring for Najib’s ousting.

In doing this, Mahathir has radically changed course. He has joined hands with a veteran Chinese opposition leader, Lim Kit Siang, whom he had once detained under the notorious Internal Security Act. He applauds the West as its authorities investigate 1MDB. But most strikingly, Mahathir appeared, even if only briefly, at a large street protest in August last year, calling for Najib’s ouster.

Malaysians were astonished by Mahathir attending this protest. And during the past week, they were stunned yet again, with Mahathir shaking the hand of his one-time deputy turned adversary, Anwar Ibrahim. Early in his prime ministership, Mahathir had recruited Anwar into his government, anointing him as successor. But later, amid the economic crisis during the late 1990s, Anwar, motivated in equal measure by reformist desires and ambition, challenged Mahathir’s leadership. Mahathir struck back, seeking to disgrace Anwar by accusing him of sodomy and corruption, then bundled him off to prison. Anwar was released in 2004, then flourished in opposition, enabling him eventually to challenge Najib. Najib responded to Anwar as Mahathir had, with sodomy charges and imprisonment. Anwar’s sentence runs until 2020.

Last week, though, Anwar was briefly freed so that he could contest in High Court an onerous new security law – a showing that evokes Malaysia’s curious mix of heavy-handedness and due process. Mahathir came to court dressed in a safari suit and backed by an entourage, then engaged Anwar for 30 minutes – their first encounter in nearly two decades. Mahathir patted Anwar’s arm and offered him support in his court case, however futile. Anwar’s wife, Wan Azizah, tweeted approvingly. The chief minister of Selangor, Azmin Ali, veering between Mahathir and Anwar, avowed that their meeting would strike fear into Najib and Umno.

Is Malaysia’s Mahathir gambling his legacy by taking on Najib?

It is an axiom in political science that every transition to democracy begins with a split between national elites, followed by coalescence among those favouring change. Mahathir has broken with Najib. He has joined forces with opposition leaders and civil society activists, even across ethnic lines. He welcomes Western intervention over 1MDB. And he seems to be reconciling with Anwar.

Is Mahathir forming this coalition and welcoming foreign pressure merely to bask one last time in the limelight? Or, in nearing the end of his long authoritarian arc, has he found virtue in electoral competitiveness and leadership turnover? Many Malaysians hope for the latter. But of course, this would gravely disappoint Mahathir’s fans in Hong Kong.

William Case is Professor in the Department of Asian and International Studies at City University of Hong Kong