Back in the 1960s and 1970s, when I was growing up in an industrial backwater town in the northeastern province of Jilin, the spectre of nuclear attacks from “American Imperialists” or “Soviet Revisionists” was palpable.

Primary school pupils were made to watch black and white films on how to protect against the effects of a nuclear explosion, a useless gimmick not unlike the “Duck and Cover” film that was popular in the west at the same time.

Mao Zedong’s (毛澤東) dictum to “dig tunnels deep, store grain everywhere, and never seek hegemony” was plastered on buildings on the streets.

But if there were fears, they were more than mitigated by the fiery propaganda about China’s own nuclear power in a country where nationalist zeal, ideological fervour and unparalleled worship towards “the brilliant leadership of Chairman Mao” had made the masses believe China was invincible.

It was only much later that we learnt – as Mao decided to develop nuclear weapons to counter nuclear threats from the United States and gain international recognition on the world stage – that China had paid a horrific price. Precious resources had been diverted to develop bombs at a time when millions of Chinese people were dying of starvation in the 1950s and 1960s.

But Mao was determined to pursue development of nuclear weapons in the face of credible threats from the US and Soviet Union to attack China’s nuclear facilities.

In 1969, military tensions between China and Soviet Union were at their highest. The Soviets were very close to launching nuclear attacks on Chinese nuclear facilities and cities, including Changchun, which is just two hours by car from where I lived.

Is Xi’s new ‘core’ status a sign of strength, or weakness?

But even as the Soviet Union mulled its nuclear options and deployed more than one million troops along the Sino-Soviet border, Mao remained defiant, setting off two hydrogen bombs within six days of each other in September 1969.

Fortunately, for that era of great power manoeuvres among China, the US and the Soviet Union, Moscow eventually backed down and a detente between Washington and Beijing quickly gathered pace.

Retracing the events of that particular period is very much relevant today, as the world faces yet another nuclear brinkmanship involving China, the US, and North Korea.

US President Donald Trump has made North Korea’s nuclear proliferation one of his top foreign policy priorities and has dialled up rhetoric through repeated warnings and flexing of military muscle. He has repeatedly urged China to do more to rein in its unruly neighbour, the latest effort being his informal summit with President Xi Jinping (習近平) in Florida last week amid warnings the US would strike North Korea alone if China did not cooperate.

To illustrate his point, Trump ordered a missile strike on Syria in the middle of his meeting with Xi, apparently serving as a warning both to North Korea and China. Later, he ordered an aircraft carrier and several other warships to the Korean Peninsula in a show of force, just two days after the summit.

On Tuesday, he piled on pressure again, Tweeting that China would get a good trade deal if Beijing helped solve the North Korea crisis. This led to a surprise phone call between Xi and Trump the following day to discuss the situation in North Korea and Syria, in which China’s President reiterated the country’s longstanding position that Peninsula denuclearisation should be achieved through peaceful means, but expressed a willingness to maintain communications and coordination with the US side.

The flurry of developments has come at a critical moment. North Korea has been testing missiles over recent months and just a day before the summit between Xi and Trump, Pyongyang tested an intermediate-range ballistic missile, apparently as a defiant show of strength.

Saturday marked the anniversary of the birth of Kim Il-sung, North Korea’s founder and the grandfather of the current leader, Kim Jong-un. In the past, North Korea usually tested missiles or took other provocative actions around such dates.

Whether the younger Kim would muster up the courage to step up his brinkmanship game in the face of mounting US military threats remains to be seen, but the North Korean propaganda machine has already made it clear that it would not be “frightened”.

Opinion: Forget the hype about leading the world, China has to get its own house in order

The three generations of leaders from the Kim family have long been portrayed as megalomaniacs in the Western media, but the history of their relentless pursuit of nuclear weapons has revealed nothing other than clear rationales and motives. It is a small, hermit country sandwiched between China and South Korea and, with a heavy US military presence nearby, has tried to use nuclear bombs to ensure security and project its power.

China’s history of developing nuclear weapons against all odds may have served as a textbook example for the Kim family to emulate – both countries shared many historical similarities and circumstances in pushing for nuclearisation.

For decades, China has been propping up the Kim regime, as it needs a buffer zone against the US military presence. But recent developments have shown that “strategic patience” with North Korea has run out for the US after many years of fruitless talks, while China’s frustrations with its neighbour have also swelled.

China recently tightened sanctions against North Korea, turning back shipments of coal, which is one of the country’s major export items.

As the dark clouds of war descend over the Peninsula, Beijing will have two choices: one is to be dragged into a conflict if the US undertakes a unilateral strike, and the other is to prepare and cooperate with the US to better protect its interests.

Others may argue that China can use its political influence to try to replace the younger Kim with a friendly ally, but that may prove equally, if not more, challenging.

The Kim family has kept ironclad rule over a country that is largely closed to the outside world. Since Kim Jong-un came to power, he has systematically eliminated the old guard and potential rivals, including his uncle and half-brother – both of whom were considered friendlier to China.

Xi-Trump summit: no winners or losers in Mar-a-Lago, but a prized first step

The least favourable option is that Trump’s flexing of military muscle turns out to be nothing more than a show and China declines to take decisive actions. But allowing North Korea to pursue its nuclear programme could lead to much bigger problems down the road. Among other things, it will give Washington the perfect excuse to strengthen its military capabilities in the Pacific, or put tactical nuclear weapons in South Korea to guard against the North. In that scenario, the US could win support among countries in the region.

More importantly, because of China’s own history and motives of pursuing nuclear weapons, Beijing should know better than anybody else about the imperative to stop Pyongyang before it is too late.

As Trump dangles trade as one inducement, it is time for Beijing to discuss a package of arrangements with Washington to resolve the North Korean issue once and for all. Items on the table could include the Terminal High-Altitude Area Defence missile system (THAAD), the US military presence in South Korea and Taiwan.

Wang Xiangwei is the former editor-in-chief of the South China Morning Post. He is now based in Beijing as editorial adviser to the paper