SINGAPORE — China’s defense minister on Sunday rejected U.S. allegations of aggressive behavior in Asia and vowed Beijing would take military action to defend its claims over Taiwan and the contested South China Sea.

Wei Fenghe defended China’s construction of “limited military facilities” on man-made islands in the South China Sea, rejecting smaller neighbors’ challenges of Beijing’s wide-ranging territorial claims in those waters.

“There is no dispute as to China’s legitimacy to build facilities on its own territories,” Wei told an audience at the Shangri-La Dialogue, a security conference in Singapore.

Rising U.S.-China tensions dominated the annual gathering of Asian defense chiefs and policymakers. A day earlier, acting U.S. Defense Secretary Patrick Shanahan accused Beijing of stealing other nations’ technology,trapping smaller countries in debt with unfair infrastructure deals and threatening force against its neighbors to assert territorial claims.

“Behavior that erodes other nations’ sovereignty and sows distrust of China’s intentions must end,” Shanahan said.

The two defense chiefs held what both sides described as a “constructive” meeting on the sidelines of the conference, where they found common ground on issues such as enforcing sanctions on North Korea. But their sharp public comments underscored the depth and breadth of the disputes dividing the world’s biggest powers.

Against the backdrop of a widening trade war, Wei’s closely watched speech — the first by a Chinese defense minister at the conference in eight years — reiterated long-standing Chinese policies but in an unapologetic tone that surprised U.S. officials and many of the delegates gathered in a cavernous ballroom at Singapore’s five-star Shangri-La hotel.

“We hold different views with the U.S. on several issues, and strongly oppose its wrong words and actions concerning Taiwan and the South China Sea,” Wei said.

He called the warships and aircraft deployed by the U.S. and its allies near disputed islands — intended to demonstrate freedom of navigation — “the most serious destabilizing and uncertain factors” in the strategically vital and resource-rich South China Sea.

China’s construction of military facilities in the waterway “is for self-defense,” Wei said. “In the face of heavily armed warships and aircraft, how can we not?”

Wei also cited U.S. arms sales to Taiwan — the self-governed island that Beijing maintains is part of China — as a hostile act.

“If anyone tries to split Taiwan from China, the Chinese military has no choice but to fight at all costs — at all costs — for national unity,” he said.

Wei accused the U.S. of unfairly targeting the Chinese telecommunications company Huawei, which has been barred from doing business with U.S. entities because of alleged links to China’s Communist Party. Pentagon officials have said they might cease sharing information with allies that use Huawei technology because it could be used for espionage — an allegation Beijing denies.

“Huawei is a private company,” Wei said. “China is opposed to the attempts of other countries to impose sanctions on a private company.”

The frictions have escalated since the Trump administration declared in late 2017 that competition among “great powers” — the U.S., China and Russia — was a cornerstone of its foreign policy.

The shift has raised concerns across Southeast Asia, a region with close security, economic and diplomatic ties to the U.S. but increasingly important trade links with its giant neighbor, China.

Many regional states openly voiced fears that the U.S.-China rivalry, if not resolved, could trigger a military conflict that could draw in smaller countries.

“The rivalry of the big powers aggravates tensions in the South China Sea,” said Malaysian Defense Minister Mohamad Sabu. “As a result, there is a greater risk of naval ships and aircraft encounters ... that could spark major conflicts.”

The Philippines, which has been the most assertive country in challenging China’s militarization of the South China Sea, said it was still seeking greater assurances from the U.S. over a decades-old mutual defense treaty.

Some Philippine officials worry that the treaty would require the country to join the U.S. in any conflict with China, a possibility that Manila says has become more likely as U.S. warships make more frequent passages through the South China Sea.

“We have to revisit it to be sure that it is still relevant in these modern times,” said Philippine Defense Secretary Delfin Lorenzana. He called the “great power rivalry” between the U.S. and China “a dangerous distraction” from serious challenges such as battling climate change and transnational terrorism.

The U.S. position hasn’t been helped by a disjointed diplomatic approach to the Asia-Pacific region.

The Trump administration has tried to rebrand the region as the Indo-Pacific, signaling its desire to more deeply involve India as a counterweight to Chinese influence, but its ties with India were damaged when Trump abruptly withdrew the country’s preferential trade status last week over a tariff dispute.

The U.S. also has left many diplomatic positions in the region unfilled, including 11% of overseas posts in East Asia and the Pacific and 21% in South and Central Asia, according to a March report by the Government Accountability Office. Several Asian officials said that in meetings, Chinese diplomats have begun to make reference to the vacancies, citing them as a sign of a diminishing U.S. commitment to Asian affairs.