The US military says one of its warships has sailed close to a disputed island in the South China Sea, eliciting an angry response from Beijing.

The US destroyer Preble sailed within 12 nautical miles of Scarborough Reef “in order to challenge excessive maritime claims and preserve access to the waterways as governed by international law”, Commander Clay Doss, a spokesman for the US Seventh Fleet, said.

The move comes against a background of increased tensions between the US and China as their trade war escalated. Last week Beijing announced new tariffs in retaliation to a US decision to increase levies from 10% to 25% on Chinese imports worth $200bn (£157bn).

China’s foreign ministry said the USS Preble had entered waters near Scarborough Reef without permission and that the Chinese navy had told it to leave.

Lu Kang, a foreign ministry spokesman, accused the US of trying to undermine peace and stability in the region.

He said: “I must stress once again that the US warship’s relevant actions have violated China’s sovereignty and undermined the peace, security and good order in the relevant sea areas. China is firmly opposed to this.

“We strongly urge the United States to immediately stop such provocative actions so as not to undermine Sino-US relations and regional peace and stability.”

Washington has long insisted that such naval operations are carried out throughout the world, including areas claimed by allies, and that they are separate from political considerations. The US government accuses China of trying to limit navigation in the area.

Beijing claims almost all of the strategic South China Sea and has built military installations on artificial islands and reefs, citing defence needs. However, Brunei, Indonesia, Malaysia, the Philippines, Taiwan and Vietnam have competing claims in the region.