Mattis's remarks came after Beijing voiced "strong dissatisfaction" Sunday after two US warships sailed by an island in the disputed Paracel Island chain.
"You'll notice there's only one country that seems to take active steps to rebuff (such operations) or state their resentment of them, but it's international waters and a lot of nations want to see freedom of navigation, so we will continue that," Mattis told reporters as he flew to Hawaii.
The US Navy periodically conducts "freedom of navigation" operations in the contested waterway, where it sails close to island features China has built into military facilities as a way of showing it rejects any territorial claims.
"We are going out of our way to cooperate with Pacific nations, that's the way we do business in the world, but we are also going to confront what we believe is out of step with international law," Mattis said.
Sunday's operation was conducted just over a week after Beijing flew nuclear-capable bombers to a disputed island, drawing immediate criticism from the US.
Last week, the Pentagon pulled its invitation to China to join maritime exercises in the Pacific over Beijing's "continued militarization" of the South China Sea.
Beijing has been building artificial islands to reinforce its claim over most of the resource-rich South China Sea, despite protests from Southeast Asian countries.
"Our diplomats are robustly engaged on this," Mattis said.
"The concerns have come to me not just from American government circles, but also from foreign nations that are concerned, very concerned about this continued militarization of features in the South China Sea."
Mattis was heading to Hawaii to attend a change-of-command ceremony for the US military's Pacific Command.
The current head, Admiral Harry Harris, has been nominated to be the new ambassador to South Korea. He will be replaced by Admiral Philip Davidson.
Mattis is then due to attend a regional security conference in Singapore.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Election Results for Lok Sabha Election 2019 will be out on May 23. Get the latest election news and live updates on ndtv.com/elections. Catch all the action on NDTV Live. Like us on Facebook or follow us on Twitter and Instagram for news updates from each of the 543 parliamentary seats for the election 2019