World leaders sounded alarms Tuesday over the widening rift between the U.S. and China, warning that a lack of cooperation could worsen the coronavirus pandemic, slow a global economic recovery or even lead to outright conflict.

“We must do everything to avoid a new Cold War,” United Nations Secretary-General António Guterres said in opening the annual U.N. General Assembly meeting in New York. “A technological and economic divide risks inevitably turning into a geostrategic and military divide.”

Chinese leader Xi Jinping, appearing at the U.N. like other leaders via video message, said Beijing has “no intention to fight either a cold war or a hot one with any country.” Yet the growing U.S.-China divide was on display as President Trump slammed Beijing for allowing the coronavirus to spread and took aim at China’s environmental and trade record.

The two leaders, who fought a bitter trade war ending in an uncertain truce this year, disagreed about the role of U.N. agencies and other global organizations as a way to grapple with the virus and other global problems.

The tech battle between the U.S. and China has battered TikTok and Huawei and startled American companies that produce and sell in China. WSJ explains how Beijing is pouring money into high-tech chips as it wants to become self-sufficient. Video/Illustration: George Downs/The Wall Street Journal

The two governments have also clashed over the South China Sea, India, Hong Kong and Taiwan, where China flexed its military muscle with flights into its airspace after a U.S. State Department official in recent days visited what Beijing considers a renegade province.

In his prerecorded U.N. speech, Mr. Trump reiterated his “America first” position, criticizing the World Health Organization and urging other heads of state to get their domestic houses in order as a way of helping the world. “Only when you take care of your own citizens will you find a true basis for cooperation,” he said.

Minutes later, Mr. Xi expressed the opposite view. “We should stay true to multilateralism and safeguard the international system with the U.N. at the core,” Mr. Xi said. “Major countries should act like major countries,” he added, and also “live up to people’s expectations.”

Mr. Xi countered Mr. Trump’s pollution criticism by saying China, the world’s biggest emitter of carbon dioxide, will strive to reach carbon neutrality by 2060 and reach its peak carbon emissions in 10 years, a pledge that drew approval from some environmental groups.

‘We should stay true to multilateralism and safeguard the international system with the U.N. at the core,’ Chinese leader Xi Jinping said.

‘We should stay true to multilateralism and safeguard the international system with the U.N. at the core,’ Chinese leader Xi Jinping said.

Photo: eskinder debebe/United Nations/Agence France-Presse/Getty Images

The rising tensions are leaving other countries caught in the middle as the traditional alliances and international groupings increasingly are in flux.

“When elephants fight, it is the grass that gets trampled flat,” President Rodrigo Duterte of the Philippines said in his address.

Messrs. Trump and Xi and Russian President Vladimir Putin all touted progress in their countries toward a coronavirus vaccine. Yet other leaders worried smaller countries could be left behind, depending on the cost and timing of vaccine doses in coming months.

Governments around the world are debating the timeline for offering Covid-19 vaccines to the public, as drugmakers speed up development. WSJ’s Daniela Hernandez explains the potential health risks linked to fast-tracking vaccines. Photo: Siphiwe Sibeko/AP

“Major powers, instead of squaring off against one another on economic and health issues, should be at the forefront of the fight against this global pandemic, as well as at the forefront of the fight to overcome the recession it has brought in its wake—rather than allowing a glaring and alarming leadership vacuum to fester, as we’ve seen today,” said Chilean President Sebastián Piñera.

The U.N. General Assembly speeches offer world leaders a platform for announcing their priorities to their peers, touting achievements at home for domestic audiences and, for democratically elected leaders, preparing for coming elections at home. The heads of state—including Messrs. Trump and Xi—are unlikely to highlight actions that are controversial at home or abroad.

The mostly virtual gathering began Tuesday with announcements at U.N. headquarters in New York that diplomats were to stay two meters (about 6 feet) apart, wear masks and avoid handshakes. Only one diplomat was permitted per country, leaving the large assembly hall largely empty.

More on Covid-19 and China

  • U.N. General Assembly: World Leaders Address Covid-19 Crisis
  • Where Trump and Biden Stand on China

Delegates for each country—usually its ambassador to the U.N.—introduced the head of state or other leader, who spoke via a prerecorded video. The whole event was easily viewable on the web, preventing the type of large gathering that normally snarls New York City traffic every fall. Nearly 200 leaders are scheduled to address the world body through next Tuesday.

In the U.S., many Democrats blame Mr. Trump for isolating the U.S. and diluting American influence in the W.H.O. or other bodies. For Mr. Trump, the threat of withdrawal is often used as leverage to influence partner countries or get allies to pay more for shared defense.

Joe Biden, Mr. Trump’s 2020 election rival, has criticized the president for going easy on China while seeking a “phase one” trade deal, and the former vice president has promised, if elected, to renew U.S. alliances as a way of putting maximum pressure on China.

“We have to start by putting ourselves in a position of strength from which to engage China so the relationship moves forward,” said Tony Blinken, senior foreign-policy adviser to the Biden campaign, at a U.S. Chamber of Commerce event Tuesday. “It’s also the best basis, by the way, upon which to advance cooperation, where we have issues of clear mutual concern, whether it’s climate, whether it’s nonproliferation or global health.”

The Obama-Biden administration worked with China on curbing carbon dioxide emissions through the Paris accord—which Mr. Trump criticized Tuesday—and negotiated the 2015 Iran nuclear deal with world powers, an agreement Mr. Trump exited.

Last weekend, the Trump administration unilaterally announced it had snapped back international sanctions on Iran, bringing additional sanctions risks to people and companies who seek to cooperate with Iran under the terms of the deal that European countries, Russia and China are seeking to prolong.

The disagreements over Iran and the concerns about China are worrying European countries and other U.S. partners, and diplomats say many leaders are waiting for the results of the U.S. presidential election to set their courses on key issues.

French President Emmanuel Macron said Europe and other countries can’t become “helpless spectators” in a world shaped by U.S.-China confrontation.

“Today’s world cannot be left to the rivalry between China and the United States,” Mr. Macron said. “The crisis, the collapse of our structures of cooperation…require us to rebuild a new order and ensure in Europe that we assume our share of responsibilities.”

Write to William Mauldin at william.mauldin@wsj.com and James T. Areddy at james.areddy@wsj.com