The United States is prepared to support China's choices if the East Asian giant promotes long-term peace and prosperity for all in the region, but it will "compete vigorously" with China 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 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, the Shangri-La Dialogue, yesterday for the second year running.
He had been expected to bring up the contentious South China Sea issue, after the US and China crossed swords over the contested waters in the past weeks.
China dispatched warships to challenge two US Navy vessels that sailed through the waters of the South China Sea recently, 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 and 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.
He also devoted a significant portion of his speech to assuring the largely regional audience of the US' commitment to their part of the world, and what he calls a "free and open Indo-Pacific".
The US, he says, "seeks to help build an Indo-Pacific where sovereignty and territorial integrity are safeguarded, the promise of freedom fulfilled and prosperity prevails for all".
It is also strengthening its partnership with India, as it values the role India can play in regional and global security, with Mr Mattis touting it as a "natural partnership" between the world's two largest democracies.
"Make no mistake, America is in the Indo-Pacific to stay."