Open this photo in gallery:

An Iranian vessel leaves Simon’s Town Naval Base in Cape Town Tuesday as BRICS Plus navies, including China, Russia and Iran, prepare for joint drills in South African waters this week.Esa Alexander/Reuters

As protests continue to rage in Iran despite a deadly crackdown by the authorities, U.S. President Donald Trump has threatened to impose an additional 25 per cent trade tariff on countries doing business with Tehran.

That could sting China, Iran’s largest trading partner, and further imperil a shaky trade war truce agreed by Mr. Trump and Chinese leader Xi Jinping late last year. The threatened tariffs come just weeks after the U.S. attacked Venezuela, another ally of Beijing’s, with the stated purpose of seizing control of the Latin American country’s oil sector, currently dominated by Chinese companies.

China imported some $47-billion worth of goods from Iran last year, according to customs data, mostly iron, copper and petroleum products. While China’s big state-owned oil companies largely exited Iran in 2022, smaller private companies specializing in sanctioned crude, many of which also partnered with Venezuela, have been a key lifeline for Tehran’s beleaguered producers, including allegedly via illicit measures concealing the origin of their imports.

Responding to Mr. Trump’s threats of tariffs, Liu Pengyu, spokesman for China’s embassy to the United States, said Beijing’s position was “consistent and clear.”

“Tariff wars and trade wars have no winners, and coercion and pressure cannot solve problems. Protectionism harms the interests of all parties,” Mr. Liu said in a statement. “China firmly opposes any illicit unilateral sanctions and long-arm jurisdiction, and will take all necessary measures to safeguard its legitimate rights and interests.”

Writing on Chinese social media, Hu Xijin, a well-connected former editor of a state-run newspaper, said Mr. Trump’s “tough-toned yet vaguely worded message is an attempt to test China and apply pressure.”

“He may be hoping to intimidate China into voluntarily giving up Iranian oil imports, or adopting a more restrained approach to accommodate his threats,” Mr. Hu said.

As with Venezuela, China is vastly more important to Iran’s economy than Tehran’s exports, even oil, are to the Chinese system. Nevertheless, Iran has long been seen as a key regional ally for Beijing, which signed a 25-year economic agreement with Tehran in 2021, pledging hundreds of billions of dollars worth of investment, and in 2023 helped oversee a historic normalization of relations between Iran and Saudi Arabia.

Today, however, Iran is even more isolated regionally than before, and implementation of the 2021 deal has stalled, with Chinese imports from Iran actually declining year-on-year since 2023.

Beijing has provided rhetorical and diplomatic support for Iran, particularly at the United Nations, and welcomed Tehran into the Shanghai Cooperation Organization – a China-dominated security forum – and the BRICS economic grouping.

Iranian naval forces are currently taking part in drills off the coast of South Africa, alongside vessels from China and other BRICS nations, despite fierce criticism from the U.S. given the ongoing protests in Iran.

In December, Iran hosted a five-day counterterrorism exercise involving participants from China and other SCO countries, which Ali Heydari, an analyst associated with the Iranian Revolutionary Guard Corp, described as a “multi-faceted message to the region and the world across political, security, and economic domains.”

For all Tehran has been happy to tout its close relationship with China, however, the limits of that friendship have been exposed in the past year. In June, when the U.S. and Israel bombed Iran’s nuclear program – originally built with Chinese assistance – Beijing criticized the action but did not halt efforts to normalize trade relations with Washington.

Similarly, it’s unclear what China could do today to provide a lifeline to the embattled Iranian regime, which even if it survives the current protests, will continue to face dire economic straits officials have so far proven themselves unable to navigate.

With pressure growing on Iran last week, popular Chinese nationalist blogger Hu Zhanhao dismissed calls for China to come to Tehran’s aid, writing the country needed to “stand on its own two feet and stop dreaming.”

Iran had been undone by its leaders’ own “arrogance” and “opportunism,” he wrote, and was “still hoping that China will take the bullet for them – that’s utterly wishful thinking!”

Any unwillingness to back Iran may come into conflict with Beijing’s reluctance to be bullied into cutting off trade with a key regional partner, however. If Mr. Trump follows through on his threats to impose further sanctions, that could in turn lead to an escalatory cycle of tit-for-tat levies, as seen throughout much of last year before he and Mr. Xi agreed their October truce.

(China, like the U.S., will also bear the brunt of any increase in global oil prices as a result of an intervention by Washington in the Iran crisis.)

Asked Wednesday about the ongoing unrest, Chinese foreign ministry spokeswoman Mao Ning said Beijing “hopes the Iranian government and people will overcome the current difficulties and safeguard national stability.”

“We oppose external forces interfering in the internal affairs of any country, disapprove of the use or threat of use of force in international relations, and hope that all parties will do more to contribute to peace and stability in the Middle East,” she added.

With files from Alexandra Li in Beijing