A U.S. Navy warship sailed close to a contested reef west of the Philippines this week, drawing the ire of Beijing which issued a statement Saturday accusing the U.S. of trespassing in its territorial waters.

China has laid claim to the reef for more than five years.

The incident took place Wednesday, two days before Defense Secretary Jim Mattis unveiled a new strategy calling China and Russia the biggest threats to the U.S., not terrorism. Mattis said the U.S. military advantage over Beijing and Moscow is “eroding.”

A U.S. official confirmed the operation to Fox News saying it was merely “innocent passage” when the USS Hopper, a guided-missile destroyer, sailed within 12 nautical miles of the uninhabited reef, Scarborough Shoal.

Chinese Foreign Ministry spokesman Lu Kang said expressed dissatisfaction with the U.S. action and China would take “necessary measures to firmly safeguard its sovereignty,” the South China Morning Post reported.

Chinese Defense Ministry spokesman Wu Qian said a Chinese missile frigate moved to identify and verify the U.S. vessel and warned it to leave the area, according to the Associated Press.

“We hope that the U.S. respects China’s sovereignty, respects the efforts by regional countries and do not make trouble out of nothing,” Wu said.

"The United States conducts routine and regular FONOPs (Freedom of Navigation Operations), as we have done in the past and will continue to do so in the future,” Navy Lt. Cmdr. Nicole Schwegman said Saturday. “We have a comprehensive FONOP program under which U.S. forces challenge excessive maritime claims across the globe to demonstrate our commitment to uphold the rights, freedoms and lawful uses of the sea and airspace guaranteed to all nations under international law. FONOPs are not about any one country, nor are they about making political statements. FONOPS are designed to comply with international law and not threaten the lawful security interest of coastal States."

Twelve nautical miles from land is the internationally recognized territorial limit for all nations. But since the international community doesn’t recognize many claims by China in the South China Sea, including its claim to the Scarborough Shoal, the U.S. demonstrates its displeasure with China by conducting “freedom of navigation” operations with Navy warships.

Unlike some of China’s man-made islands elsewhere in the South China Sea, Scarborough Shoal is uninhabited and does not have a runway or any military fortifications. But the intelligence community has been watching the island for years as Chinese survey teams and dredging equipment have been seen lurking around the reef.

The South China Sea has crucial shipping lanes, rich fishing grounds and potential oil, gas and other mineral deposits.

China claims virtually the entire South China Sea and has carried out extensive land reclamation work on many of the islands and reefs it claims, equipping some with airstrips and military installations.

The United States does not claim territory in the South China Sea but has declared it has a national interest in ensuring that the territorial disputes there are resolved peacefully in accordance with international law.

The Associated Press contributed to this report.