Senior military officials from the United States and China used a conference in Singapore to push competing visions of Asia’s future security: a U.S.-led safety net of well-armed partnerships versus a region where China is the center of a new international order.

The U.S. Defense Secretary Lloyd J. Austin III and officials from allied countries argued — implicitly or explicitly — that Russia’s invasion of Ukraine showed that Asia should urgently embrace a network of U.S.-led alliances to tame the growing might of China. On Sunday, the Chinese defense minister, General Li Shangfu, methodically laid out criticisms of the United States and presented Beijing as a contrast in leadership, increasingly confident in using its political, economic and military power to keep Asia stable.

“Certain countries willfully interfered in other countries’ internal matters and regional affairs, frequently resort to unilateral sanctions and armed coercion,” General Li said in an unmistakable reference to the United States and its allies. They “create chaos in a region and then walk away, leaving a mess behind,” he said. “We never want to let this be replicated in the Asia-Pacific.”

The Shangri-La Dialogue in Singapore where Mr. Austin and General Li spoke is one of the few regular forums where Beijing and Washington try to publicly win over Asian policymakers and publics. And this year’s meeting, which included defense ministers from Ukraine, Britain, Germany and Canada, cast in sharp relief how the rivalry between the United States and China is becoming a contest over the future global geopolitical landscape: toward a resurgent American-dominated order with more active and engaged partners, or to one in which China leads, at least in Asia.

Hanging over their competing narratives was the war in Ukraine, along with the threat of conflict in Asia where the risks of a volatile, unexpected collision between China and the United States appear to be rising. On Saturday, the United States’ Indo-Pacific Command said that an American naval destroyer, the U.S.S. Chung-Hoon, slowed to avoid a possible collision with a Chinese Navy ship that crossed in front of the Chung-Hoon as it passed through the strait between China and Taiwan.

General Li downplayed the near miss, saying that the best way to avoid an accident was for countries outside the region, like the United States, to leave and “mind your own business.”

Many European officials at the conference, however, argued that their governments should become more involved in Asia, to protect their economies, and that Asian countries should do more to support Ukraine.

Josep Borrell Fontelles, a foreign affairs and security official with the European Union, called the war in Ukraine “a game changer” that had taught Europe “nothing is far away in a globalized world.” Security failures in one region “affect everyone, everywhere,” he said.

As evidence, many European defense officials cited rising food prices worldwide caused by a stranglehold on grain exports from Ukraine.

And they sought to portray Russia (which did not participate in the conference) as a near-term threat to Asia with an able navy operating north of Japan and a global program designed to sabotage undersea cables connecting the internet and energy supplies across the region.

“All of those capabilities are coming into the Pacific, and we should realize what that means for our vulnerabilities,” said Ben Wallace, Britain’s defense minister.

China rejected the idea that Europe needed to play a bigger role in Asian security, describing it as a ploy by the United States to establish an Asian-Pacific version of the North Atlantic Treaty Organization.

Speaking at the conference, China’s former ambassador to the United States, Cui Tiankai, said the “best thing” Europe could do for Asia was to “do nothing,” adding, “we don’t need an Asian NATO.”

Mr. Cui, who sat on a panel next to Ukraine’s defense minister, Oleksii Reznikov, urged Europe to learn from Asia’s “success” in maintaining regional peace, and said China should learn from Europe’s “lack of success” by comparison.

It was a point that uniformed Chinese commanders made repeatedly — that, in Beijing’s view, the West’s efforts to encircle Russia had forced Moscow to go to war, and that any such strategy to contain China might provoke a similar outcome. As another Chinese official asked at the forum: “Have you ever thought that this way of containing itself is a problem, or is a kind of failure, proved by the war in Ukraine?”

But in a venue where Russia’s invasion was frequently described in the harshest terms, China’s continued support for Russia drew criticism as well. At the end of the session with Mr. Cui, Mr. Reznikov turned and spoke directly to the Chinese envoy about the shifting power dynamics between China and Russia. Unlike decades ago, he said, China was now the “older brother” and Russia the “younger brother.”

“Would you say to the younger brother to stop invading Ukraine?” Mr. Reznikov said, drawing applause from the room.

Highlighting the divide between Western powers and many developing countries on the question of the war, Indonesia’s defense minister, Prabowo Subianto, proposed a peace plan in Ukraine that did not include the withdrawal of Russian forces. Instead, he called for a ceasefire, the establishment of a demilitarized zone and an eventual referendum in contested territories.

The proposal drew instant criticism from Western officials, as well as from Mr. Reznikov.

“I will try to be polite,” Mr. Reznikov said, adding: “It sounds like a Russian plan.”

Ian Chong, a political scientist at the National University of Singapore, said that many of the countries trying hardest to stay away from having to choose sides between the United States and China, such as Indonesia, may soon find themselves unable to influence the dynamic, as a growing number of countries outside the region seek to play a greater role.

“The problem is the world’s changing,” he said, adding: “That more passive attitude means they’re not a party to how it’s shaped.”

And even countries that have toggled between leaning toward Washington and Beijing expressed skepticism about China’s promises.

Filipino military officials highlighted the gap between Chinese pronouncements and its actual maneuvers — citing several recent cases of aggressive behavior by the Chinese Coast Guard, including harassment of fishing boats, in the exclusive economic zone of the Philippines.

“While China is talking about dialogue, China’s actions show confrontation,” said Commodore Jay Tarriela of the Philippines Coast Guard.

That wariness about China’s intentions and ambitions has spurred America’s allies in the region to strengthen their military ties with the West. Japan has led the way, announcing a few weeks ago that it was working toward the opening of a NATO liaison office in Tokyo.

While Chinese officials were quick to describe such efforts as futile and dangerous, Yasukazu Hamada, Japan’s defense minister, stressed that linkages across countries and regions were “not about fighting.”

“Even when we expand military capability, diplomacy is more important,” he said.

It was one of several veiled references to China’s refusal to respond to requests from the United States for direct talks between the two countries’ senior military officials.

General Li, who has a background in aerospace engineering, was thought to be less strident than his peers in the People’s Liberation Army, and his attendance in Singapore had been taken by some as a sign that China wanted to strike a more amicable tone at the forum.

Still, Mr. Li did not meet with Mr. Austin, only briefly shaking hands at a dinner Friday night. On Sunday, he warned that China would not flinch in defending its rights and interests by quoting the words of a song:

“When friends visit, bring out the fine wine. When jackals and wolves visit, bring out the shotgun.”