HONG KONG — When the aircraft carrier John C. Stennis and four other American warships sailed into the South China Sea last week for what were described as routine exercises, the message was clear: The United States is the dominant military power in the region and plans to keep it that way.

But numerous Chinese naval ships were operating nearby, the United States Navy said, noticeably more than in past years. A Chinese officer told the state-run news media that the ships were there to “monitor, identify, follow and expel” foreign vessels and aircraft, depending on how close they came “to our islands.”

The encounter, which passed without incident, was the latest episode in a wary standoff between the United States and China over two contested island chains known as the Paracels and the Spratlys.

Since taking office three years ago, President Xi Jinping has used the isles to expand China’s military footprint in the region, taking one step after another to build and equip outposts far from the Chinese mainland over protests from its neighbors and from Washington.