China has warned the United States that its risky military actions near disputed islands would not affect Beijing’s resolve to protect its interests in the South China Sea.

“China won’t be scared by any so-called military ship or aircraft, and we will only even more staunchly all necessary steps to defend the country’s sovereignty and security, to protect the peace and stability of the South China Sea region,” Chinese Foreign Ministry spokeswoman Hua Chunying said on Wednesday after reports emerged that two US Air Force B-52 bombers had flown near disputed islands in the region.

Hua said despite claims by Washington that China is militarizing the South China Sea by building facilities on disputed reefs and small islands, it was in fact the United States' actions, like sending “this type of offensive weapon”, that could be counted as a form of militarization.

“Running amuck is risky,” said the official, urging the US to stop hyping up the issue of militarization and provoking trouble.

China claims the entire South China Sea, where China, Taiwan, Vietnam, Malaysia, Brunei and the Philippines all have competing claims.

On Saturday, US Defense Secretary Jim Mattis accused China of coercive actions in the region, which he said dashed Washington’s hopes for work with China on a “results-oriented” relationship. He said the US would “compete vigorously” if China continued to expand its military presence in the area.

Vietnam and the Philippines expressed concern last month after China’s air force launched its training exercise in the South China Sea and landed bombers on the disputed islands. Later that month, Western media published satellite images showing that truck-mounted surface-to-air missiles or anti-ship cruise missiles had apparently been deployed at Woody Island in the disputed sea.