BEIJING — Beijing's Defense Ministry on Thursday warned the US Navy to "be careful" in the South China Sea and slammed a newly signed agreement between Washington and the Philippines.

Earlier this month, Manila agreed to give US forces access to five military bases, including some close to the disputed South China Sea, where tensions have risen over Beijing's assertion of its territorial claims.

China claims virtually all the South China Sea despite conflicting claims by Brunei, Malaysia, Vietnam, Taiwan and the Philippines, and has built up artificial islands in the area in recent months, including some with airstrips.

Washington has since October carried out two high-profile "freedom of navigation" operations in which it sailed warships within 12 nautical miles of islets claimed by China.

Asked about a recent report on US patrols in the sea, Defense Ministry spokesman Yang Yujun told a briefing on Thursday: "As for the US ships which came, I can only suggest they be careful."

The agreement between Washington and Manila applies to the Antonio Bautista Air Base on the western island of Palawan, directly on the South China Sea.

Asked about the deal, Yang said: "To strengthen military alliances is a reflection of a Cold War mentality."

× Transitioning out of the service? Sign up for the Rebootcamp Newsletter to receive helpful information on education, employment and entrepreneurship. Thanks for signing up. By giving us your email, you are opting in to the Rebootcamp Newsletter.

"It is in the opposite direction of the trends of the era for peace, development and cooperation," he said, adding bilateral military cooperation "should not "undermine a third party's interests."

Washington regularly accuses Beijing — which says it has built runways on and deployed unspecified weapons to islands in the South China Sea — of militarizing the area.

Beijing denies the accusations and says US patrols have ramped up tensions.

"Now, the United States has come back, and is reinforcing its military presence in this region and promoting militarization in the South China Sea," Yang said.

Beijing acknowledges that the facilities on its new islands will have military as well as civilian purposes.

China's comments came as Malaysia accused "a large number" of Chinese fishing trawlers and a coast guard vessel of entering its waters, understood to be last week.