A guided-missile destroyer conducted a freedom of navigation operation in the South China Sea Tuesday in the latest message from the U.S. to Beijing over its disputed territory in the Spratly Islands. 

An official told Fox News the USS John S. McCain sailed by Gaven Reef and Johnson South Reef, which have both been claimed by China and fortified with weapons in recent years.

"This freedom of navigation operation ("FONOP") upheld the rights, freedoms, and lawful uses of the sea recognized in international law by challenging restrictions on innocent passage imposed by China, Vietnam, and Taiwan," the 7th Fleet Public Affairs wrote in a statement. "All interactions with foreign military forces were consistent with international norms and did not impact the operation."

US GUIDED-MISSILE SUBMARINE ENTERS PERSIAN GULF IN LATEST SHOW OF FORCE TO IRAN

 The USS John S. McCain transits through the South China Sea while conducting routine underway operations. (Mass Communication Specialist 2nd Class Markus Castaneda/ US Navy)

China is one of six nations -- including the Philippines, Vietnam, and Taiwan -- that assert sovereignty over all or parts of the disputed archipelago. China, Vietnam, and Taiwan require "either permission or advance notification" when Navy vessels pass through the area. 

"Unlawful and sweeping maritime claims in the South China Sea pose a serious threat to the freedom of the seas, including the freedoms of navigation and overflight, free trade and unimpeded commerce, and freedom of economic opportunity for South China Sea littoral nations," the statement said. 

"By engaging in innocent passage without giving prior notification to or asking permission from any of the claimants, the United States challenged the unlawful restrictions imposed by China, Taiwan, and Vietnam," it continued. "The United States demonstrated that innocent passage may not be subject to such restrictions."

The Gaven Reef and Johnson South Reef don't have runways and hangers like some of China’s other contested reefs in the Spratly Islands. The U.S. warship also sailed past Vietnamese claimed Collins Reef. 

A Chinese warship shadowed McCain during the operation, but all interactions were deemed "safe and professional," an official told Fox News.

CHINA TAILS US WARSHIP AS IT SAILS THROUGH TAIWAN STRAIT

Last month, the McCain was sent out to challenge Russia’s "excessive" maritime claims in the Western Pacific, officials said. The destroyer "asserted navigational rights and freedoms" through a freedom of navigation operation near the Peter the Great Bay in the Sea of Japan, a 7th Fleet statement said.

The U.S. has previously carried out similar operations near China, which continues to assert expansive territorial claims. The Navy often sends warships through the strategic South China Sea.

CLICK HERE TO GET THE FOX NEWS APP

"As long as some countries continue to assert maritime claims that are inconsistent with international law as reflected in the 1982 Law of the Sea Convention and that purport to restrict unlawfully the rights and freedoms guaranteed to all States, the United States will continue to defend those rights and freedoms," the Navy said.

Fox News' Lucas Tomlinson and Stephen Sorace contributed to this report