The United States is prepared to support China's choices if they promote long-term peace and prosperity for all in the region, but it will "compete vigorously" with the East Asian giant if it must, said US Defence Secretary James Mattis.
"There will be consequences to China ignoring the international community," said Mr Mattis, referring to China's militarisation in the disputed South China Sea and its competing claims with Vietnam, the Philippines, Taiwan, Malaysia and Brunei over the islands there.
One of those consequences was the disinvitation by the US to China recently for the US-hosted biennial naval drill, the Rim of the Pacific (Rimpac) exercise.
"To muscle their way in is not the way to make long-term collaboration in a region that is important to China. There are consequences that will come home to roost if they don't find a way to work collaboratively with neighbours who have interests," warned Mr Mattis.
But he also added that the US will continue to pursue a "constructive, results-oriented relationship" with China and "compete vigorously if we must".
The Pentagon chief was speaking at the Asian security conference, Shangri-La Dialogue, on Saturday (June 2) for the second year. He had been expected to bring up the South China Sea issue, after the US and China crossed swords over the contentious territory in the past weeks.
China dispatched warships to challenge two US Navy vessels that sailed through waters in the South China Sea last week, saying the US had "gravely violated Chinese sovereignty". The US, in turn, said it was simply conducting routine Freedom of Navigation exercises.
China has been ramping up its deployment of missiles and other defence systems to the disputed territory, reinforcing its bases in the Paracel islands and the Spratly islands.
"Despite China's claims to the contrary, the placement of these weapon systems is tied directly to military use for the purpose of intimidation and coercion," said Mr Mattis, but he added that the US is not asking regional countries to take sides.
He also singled out Chinese President Xi Jinping for going back on his word after he made a promise at the White House in 2015 that Beijing would not militarise the islands in the South China Sea.
But Mr Mattis also struck a positive note in mending ties. He will travel to Beijing soon for talks, he said.
In his half-hour speech, Mr Mattis also reaffirmed the US' commitment to the region, and its support for Asean centrality and what he calls a "free and open Indo-Pacific".
It is strengthening its partnership with India, he said. "US values role India can play in regional and global security and we value it as natural partnership as the world's two largest democracies."
"Make no mistake, America is in the Indo-Pacific to stay," said Mr Mattis.