The warning came after the US Pacific Fleet said that its guided-missile cruiser USS Chancellorsville had sailed near the disputed Paracel Islands in the South China Sea to challenge what it described as Beijing's "excessive maritime claims."

Beijing has lodged a protest against a US navy ship sailing close to the disputed islands in the South China Sea, according to Chinese foreign ministry spokesperson Geng Shuang.

He said that the US ship had entered Chinese waters without permission and that Beijing had made its position known with its "stern representations".

Geng added that the Chinese military "had sent its ships to watch the US vessel and to warn it to leave the area."

READ MORE: US Voices Opposition to China's Military Steps in South China Sea

"Beijing urges the American side to immediately stop such provocative actions, which violate China's sovereignty and threaten security," he underscored.

Earlier on Friday, US Navy Commander Nathan Christensen, a spokesman for the US Pacific Fleet, told CNN that the guided-missile cruiser USS Chancellorsville "sailed near the Paracel Islands to challenge excessive maritime claims and preserve access to the waterways, as governed by international law.

Christensen added that the Chancellorsville conducted what is referred to as a "Freedom of Navigation Operation" in the vicinity of the Paracel Islands to challenge claims made by China. He noted that the US warship was shadowed by a Chinese vessel but that all interactions were deemed safe and professional.

READ MORE: ASEAN Does Not Want South China Sea to Become Competitive Arena — Professor

"US Forces operate in the Indo-Pacific region on a daily basis, including the South China Sea. All operations are designed in accordance with international law and demonstrate that the United States will fly, sail and operate wherever international law allows," Christensen stressed.

Over the past few years, Beijing has cultivated a slew of military assets in strategic areas of the South China Sea for what it calls national defence purposes.

The resource-rich sea, which is also enormously important for trade in and out of Asia, is contested by numerous southeast Asian nations, which each claim unique and frequently overlapping rights to reefs, islets and fishing waters within the area.

READ MORE: Pentagon Chief: US 'Cannot Accept' China's 'Militarization' in South China Sea

Apart from China, the Spratly Islands and Paracel Islands, which are among the more frequently disputed territories, are also claimed by Taiwan, Vietnam, Malaysia and the Philippines. China has exerted de facto control over the Paracels since 1974.

US officials have long expressed alarm at Beijing's construction of industrial outposts and military facilities on artificial islands in the South China Sea but have mostly limited their reaction to verbal reproach.

US Navy ships continue to carry out "freedom of navigation" operations in these areas, with US Air Force bombers sometimes conducting flyovers of the South China Sea.