It may be hard to imagine, but 25 years ago, the Chinese Communist Party was nearly toppled by a nationwide pro-democracy movement. It was the late paramount leader Deng Xiaoping's steely nerves and the tanks of the People's Liberation Army - dispatched to enforce martial law and suppress the protests in Beijing's Tiananmen Square - that enabled the regime to avoid collapse, at the cost of several hundred civilian lives.

On the 25th anniversary of the Tiananmen Square massacre of June 4, 1989, two questions stand out: how has the party survived the last quarter of a century, and can its rule endure for another 25 years?

The answer to the first question is relatively straightforward. Policy adjustments, clever tactics of manipulation, and a healthy dose of luck enabled it to win the support it needed to retain power and suppress destabilising forces.

To be sure, serious mistakes were made. Following the massacre, China's conservative leaders attempted to reverse the liberalising reforms that Deng had initiated in the 1980s, plunging the economy into recession. And the Soviet Union's implosion in 1991 caused a panic in the party.

But Deng again managed to save the party. Mustering all of his energy and political capital, the then 87-year-old leader revived pro-market reforms, unleashing an economic revolution that delivered an unprecedented wave of growth and development, thereby boosting the party's credibility considerably.

Deng and his successors buttressed this trend by granting Chinese citizens considerable personal freedoms, fuelling the emergence of a culture of crass consumerism and mass entertainment. In this new world of "bread and circuses", it was far easier for the party to regain public support and suppress the opposition. Carefully orchestrated moves to promote Chinese nationalism and exploit xenophobia also helped.

Even repression, the mainstay of the regime's survival, was fine-tuned. China's newly acquired wealth enabled its leaders to build one of the world's most technically sophisticated internet firewalls and equip its internal security forces with the most effective tools.

In dealing with China's small but resilient dissident community, the regime depends on the strategy of "decapitation". In other words, the government eliminates the threat posed by leading opposition figures by jailing them or forcing them into exile, regardless of their prominence. Liu Xiaobo - who won the 2010 Nobel Peace Prize - was sentenced to 11 years in prison, despite worldwide protest.

However cynical, the approach has worked. But the party might not have been quite so successful had it not got lucky in a few critical areas. For starters, the post-1992 reforms coincided with a surge of globalisation, which provided China with massive capital inflows (about US$1 trillion in foreign direct investment since 1992), a slew of new technologies, and virtually unimpeded access to Western consumer markets. China thus became the workshop of the world, with its exports rising more than tenfold by 2007.

Another factor that worked in the regime's favour was the so-called demographic dividend (an abundant labour force and a relatively small percentage of children and elderly dependents). This provided China with plentiful low-cost labour, while saving the government large expenditure on pensions and health care.

The problem facing the party now is that most of the factors that enabled it to survive since Tiananmen have either already disappeared or are heading in that direction. Indeed, for all practical purposes, pro-market reforms are dead. A kleptocracy of government officials, their families and well-connected businessmen has colonised the Chinese state and is intent on blocking any reforms that might threaten their privileged status.

Moreover, the party can no longer count on rising prosperity to sustain public support. Rampant corruption and rising inequality, together with obvious environmental decay, are causing ordinary Chinese - especially the middle class, which once had high hopes for reform - to become increasingly disillusioned.

At the same time, given rapid population ageing, China's demographic dividend has all but dissipated. And, given that China is already the world's largest exporter, there is little room left for export growth in the coming years.

That leaves only repression and nationalism in the party's post-Tiananmen toolkit. And, indeed, both of them continue to play a central role in President Xi Jinping's strategy for ensuring the party's survival.

But Xi is also experimenting with two new devices: an unprecedented anti-corruption campaign and an attempt to revive pro-market reforms. So far, his war on corruption has made a bigger impact than his plan for economic reform.

On the surface, Xi's strategy seems sound. But waging war on corrupt officials and pressing for deep reforms aimed at dismantling China's kleptocracy will inevitably bring Xi into conflict with China's political and economic elites. The question is how he can overcome their resistance without rallying the Chinese people, whose political mobilisation could endanger the one-party system.

The Communist Party defied the doomsayers after 1989: it survived and preempted any further threats to its power. But the odds that it can hold on for another quarter of a century have grown long - and are unlikely to improve.

Minxin Pei is professor of government at Claremont McKenna College and a non-resident senior fellow at the German Marshall Fund of the United States. Copyright: Project Syndicate

This article appeared in the South China Morning Post print edition as: