Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

BEIJING — A U.S. destroyer sailed within 12 nautical miles of artificial islands built by China in disputed waters on Tuesday in an open challenge to Beijing's territorial claims.

The ship did not encounter any resistance, but was trailed by Chinese ships during the transit in the South China Sea, a U.S. defense official told NBC News. It also triggered an angry response from Beijing.

U.S. destroyer USS Lassen on Tuesday sailed close to the Subi Reef, part of the disputed Spratly Islands in the South China Sea. DigitalGlobe via Getty Images

"The actions of the U.S. warship have threatened China's sovereignty and security interests, jeopardized the safety of personnel and facilities on the reefs, and damaged regional peace and stability," China's Foreign Ministry said in a statement on its website after the destroyer USS Lassen sailed close to the Subi Reef in the Spratly Islands.

The "U.S. side [should] think twice, not ... take rash moves and stir up troubles," China's Foreign Minister Wang Yi warned in a separate statement.

A U.S. defense official said the mission was part of an ongoing global effort to keep international waters open for navigation in the face of “excessive maritime claims.” The official denied the U.S. was specifically targeting China.

China says virtually all of the South China Sea belongs to it. Beijing's claims over the group of at least a half dozen dredged islands, one of which includes a recently completed two-mile airstrip, have angered the Philippines, Vietnam, Malaysia, Brunei, and Taiwan, which have overlapping claims in the waters.

Related: China Builds Runway on Reef in Disputed Sea: Pentagon

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The Spratlys sit in an area potentially rich in oil and gas reserves.

Along with other island chains in the South China Seas, Beijing claims the Spratlys as part of China’s territory and argues that international law grants them a 12-mile exclusion zone. While the U.S. officially does not take sides in the dispute, it also does not recognize the exclusion zone.

“We have been clear that we take no position on competing territorial sovereignty claims to land features in the South China Sea,” a Pentagon official told NBC News on Monday night.

The U.S. Navy guided-missile destroyer USS Lassen sails in the Pacific Ocean in November 2009. U.S. Navy / Reuters File

Tuesday’s patrol had been in the works for some time and U.S. officials in recent weeks have openly spoken about it in order to inform claimant countries in the region that the move was imminent, according to Pentagon officials who spoke to NBC News on condition of anonymity.

U.S. ally the Philippines welcomed the move as a way of helping maintain "a balance of power."

International law permits military vessels the right of "innocent passage" in transiting other country's seas without notification. China's Foreign Ministry though labeled the ship's actions as illegal.

This is the latest patrol into this disputed exclusion zone since 2012.

Related: China Reveals What's 'Unacceptable' in Disputed Waters

The Obama administration is trying to assert its right to sail and operate freely in a region where billions of dollars in American and international shipping regularly cross.

"Make no mistake, the United States will fly, sail and operate wherever international law allows, as we do around the world, and the South China Sea is not and will not be an exception," Defense Secretary Ash Carter said on Oct. 13.

In a statement issued later Tuesday, Australia's government said while it was not involved in U.S. activity in the South China Seas it "strongly supported" the right all states have "under international law to freedom of navigation and freedom of overflight."

"Australia has a legitimate interest in the maintenance of peace and stability, respect for international law, unimpeded trade and freedom of navigation and overflight in the South China Sea," according to the Defense Ministry statement, which added that around 60 percent of the country's exports pass through the area.

The issue quickly prompted patriotic fury among social media users in China. Within hours it became a top trending topic on Weibo, the country's Twitter-like service, with tens of thousands of comments and over 20 million views.

“Let us send our aircraft carrier to the South China Seas and the U.S. Navy won't dare to come again,” wrote one angry user. “Never trust Western countries.”