TAIPEI, Taiwan — In recent days, Beijing got a taste of President Biden's new China strategy: First came the dressing-down over human rights by Secretary of State Antony Blinken at a meeting in Alaska. Days later, the European Union, Britain, Canada and the United States joined to censure China's abuses in Xinjiang with coordinated sanctions. Australia and New Zealand chimed in with statements of condemnation.

Now, Beijing is demonstrating it has friends, too.

Two months into the Biden presidency, the administration’s strategy of rallying U.S. allies to pressure China is already yielding visible results. But the tactic is pushing Beijing to cement ties with its own partners, which represent some of the most vexing geopolitical regions facing successive U.S. presidents: Russia, North Korea, Iran.

China on Saturday announced it signed a 25-year strategic cooperation agreement with Iran, deepening ties between two countries both under U.S. sanctions. Chinese commerce with Iran has played large in Beijing’s conflict with Washington, with Huawei Chief Financial Officer Meng Wanzhou detained in Canada over alleged Iran sanctions violations.

Although China has expressed willingness to cooperate with Washington on a range of issues, it’s signaling it retains vast influence among countries outside the Western orbit, which could potentially complicate Biden’s international agenda in an increasingly polarized world.

The Biden administration is “pursuing containment, even if they don’t call it that,” Jia Qingguo, a Peking University professor who sits on a Chinese national advisory body on foreign policy, said in an interview.

“Whether they intend it or not, the consequence is pushing us into a bifurcated world,” Jia said. “In China, more people are thinking we need to form our own closer security relationships with certain countries, and there are others who worry about this road we may have to take.”

For China, sanctions announced on March 22 by the European Union against officials in Xinjiang amounted to a stinging rebuke from a key Western bloc that China believed it had won over last year with an investment treaty. China was outraged by the sanctions and immediately hit back against European politicians and academics by levying its own, throwing the long-sought accord into jeopardy.

The war of words escalated spectacularly as European governments summoned Chinese ambassadors to express their displeasure — the veteran envoy to France, Lu Shaye, pointedly ignored his summons — while China angrily pointed to Europe’s historical record of atrocities, including the Holocaust.

Just as China’s relations with Europe imploded, Russia stepped in.

On March 22, 72 hours after a heated meeting between Blinken, national security adviser Jake Sullivan and their Chinese counterparts, Russian Foreign Minister Sergey Lavrov landed in China, where he urged China and Russia, two “like-minded countries,” to join forces to dismantle the U.S. dollar’s grip over the international payments system that enables U.S. sanctions. The United States was “relying on the military-political alliances of the Cold War era,” Lavrov told reporters in Guilin, while also taking a swipe at Brussels.

China’s foreign ministry responded approvingly.

“The United States and its ‘Five Eyes’ allies coordinated this week as if they’re starting a gang fight,” said the ministry spokeswoman, Hua Chunying. “Just look at the map and you will know that China has friends all over the world. What would we worry about?”

It was the latest showcase for warming ties between China and Russia, two historically distrusting neighbors.

In 2018, Russian President Vladimir Putin made pancakes with Chinese leader Xi Jinping in Vladivostok as Chinese soldiers joined 300,000 Russian troops for the biggest Russian military drill since the Cold War. In recent years, Russia has grown increasingly enmeshed inside China’s economic engine. Russia’s gross domestic product is dwarfed by China’s, but it plays a crucial role as China’s second biggest oil supplier, closely behind Saudi Arabia.

Michael McFaul, former ambassador to Moscow under President Barack Obama, said Xi and Putin were driven together by both geopolitical necessity and their autocratic, nationalistic personalities.

But beyond the rhetorical bluster of standing together against the West, the picture is more nuanced, said McFaul, a Stanford University historian who is writing a book about the three-way relationship among the United States, Russia and China.

“Putin has made up his mind that we’re the enemy, our multilateral institutions are the enemy, and he would like China to join him in an illiberal bloc,” he said. “I get the sense the Chinese haven’t made that decision yet. They’re uncomfortable with blocs.”

In the case of Europe, Chinese leaders surveying the landscape after a tumultuous week may feel that relations are salvageable, said Bruno Macaes, a former Portuguese official for European affairs and a fellow at the Hudson Institute.

Individual countries can still hammer out unilateral trade deals with China, and trade could still flourish, even if it’s highly unlikely that the investment treaty with China will now be ratified by a parliament that includes members who have been blacklisted and punished by Beijing, he said. Under the Chinese sanctions, the European lawmakers, researchers and their families cannot do business with China.

Macaes noted that China now accounts for about 40 percent of sales for the three largest German carmakers: Volkswagen, BMW and Daimler. “These sanctions don’t mean economic decoupling,” he said.

In the meantime, China is quickly shoring up support among more reliable allies around the world.

Last week, Xi sent a message to North Korean leader Kim Jong Un hailing the relationship between the two historical comrades as a “valuable asset” and promising humanitarian aid. Kim, meanwhile, stressed “unity and cooperation” with China in the face of a “hostile” new U.S. administration, according to North Korean state media.

North Korea fired off its first missile test of the Biden administration the previous weekend, U.S. officials said.

And on Wednesday, Chinese Foreign Minister Wang Yi left for a swing around the Middle East, a divided region that will give him an almost uniformly friendly welcome. Wang’s stops include Saudi Arabia, Turkey and Iran, an oil economy under U.S. sanctions that is being propped up in significant part by Chinese oil purchases.

Few details were announced on Saturday of the 25-year China-Iran partnership. A previous leaked draft document of unclear provenance had suggested a wide-spanning agreement including infrastructure, telecommunications and security cooperation.

Jia, the Chinese government adviser, said China continues to be willing to help on a multilateral efforts to denuclearize North Korea and Iran, or to resume the Paris climate accord, and would not necessarily link cooperation on these issues with areas of friction with Washington.

But don’t test China’s patience, he warned.

“China believes it’s a stakeholder of the existing international order, but if you take away its stake, you’ll see a much different face,” he said. “To help Americans while they keep bashing you? I don’t think China would do that.”

Eva Dou in Seoul contributed to this report.

This story has been updated with the March 27 announcement of the Iran-China agreement.