My Malaysian friends were euphoric following the ousting of the Barisan Nasional (National Front) government in the country’s 14th general election on May 9. The party and its predecessor, the Parti Perikatan (Alliance Party), had been the dominant ruling coalition in Malaya, and later Malaysia, since the country’s independence from the United Kingdom in 1957.

But not any more. The country’s erstwhile political hegemony was broken earlier this month after a decisive electoral victory by the Pakatan Harapan (Alliance of Hope), an association of parties that encapsulates the cliché “politics makes strange bedfellows” better than any other. The party’s two main leaders – Mahathir Mohamad, Malaysia’s new (and former) prime minister, and Anwar Ibrahim – have had a fraught relationship, but decided to set their enmity aside and become allies to topple the Barisan Nasional.

‘Now I have freed him,’ says Malaysia’s Mahathir, as Anwar walks

A historical example of a similar unlikely alliance united against a common enemy can be found in the Donglin partisan conflict during the final decades of the Ming dynasty (1368-1644). The Donglin partisans, named after the Donglin Academy from which many of its members hailed, were a group of intellectuals who sought to rectify the corrupt government of the day by reviving Confucian mores among the governing elite.

As they grew in number and influence, the group became increasingly self-righteous and exclusionary, especially after several attained high office. Their arrogance, as well as political ruthlessness, eventually drove non-Donglin-partisans to throw their lot in with the eunuchs, banding together two groups who had been adversaries since the Han period (206BC – AD220).

On one side were the administrators and bureaucrats, most of whom were steeped in Confucian classics and abided by Confucian standards of conduct, and for whom career advancement was, in theory at least, meritocratic. On the opposite side were the uneducated eunuchs, whose political power lay in close personal relationships with the emperor in their capacities as palace servants.

How North and South Korea’s potential reunification recalls China’s divided past

While the union was indeed extraordinary, it was by no means successful, resulting instead in an unfortunate and bloody mess.

At first, many members of the Donglin partisans were murdered and the Donglin Academy burnt to the ground, but later the eunuchs’ clique was decimated when emperor Chongzhen (1627-44) killed its ringleader, Wei Zhongxian, in 1627 and reinstated the Donglin partisans. However, the emperor soon fell out with them and came to depend on the people closest to him: his personal servants, the eunuchs. No wonder the Ming dynasty was doomed to fall.

Let’s hope that the improbable Mahathir-Anwar alliance in Malaysia has a more rewarding conclusion.