A US Navy mapping ship confronted by Chinese vessels in the South China Sea over the weekend was operating illegally, China's Foreign Ministry said Tuesday, in its first formal comment on the latest friction between the two militaries. Responding to US accusations that Chinese boats operated recklessly and without cause, Chinese Foreign Ministry spokesman Ma Zhaoxu said the claims were wrong. "The US claim is totally inaccurate and confuses right and wrong and is unacceptable to China," Ma said at a regularly scheduled news conference. The ship, the USNS Impeccable, "broke international and Chinese laws in the South China Sea without China's permission," Ma said. The US Defense Department says Chinese ships surrounded and harassed the Navy vessel in international waters Sunday, at one point coming within 25 feet (8 meters) of the American boat and strewing debris in its path. The episode, the latest in a series of confrontations between US surveillance craft and Chinese coastal defenses, took place in international waters in the South China Sea, about 75 miles (120 kilometers) south of Hainan Island. The incident had overtones of spycraft, but the US ship is not, strictly speaking, a spy ship. It maps the ocean floor with sonar, compiling information the Navy can use to steer its own submarines or track those of other nations. The Impeccable's crew resorted to spraying one Chinese vessel with water from fire hoses to force it away. Despite the impact of the water, Chinese crew members stripped to their underwear and continued closing in, the US Defense Department said. The US Embassy in Beijing said a protest was lodged with the Chinese Foreign Ministry as well as with the Chinese Embassy in Washington. It said the Impeccable had been conducting "routine operations in the South China Sea in accordance with customary international law." "The actions of the Chinese vessels put both sides at risk and are inconsistent with the obligation for ships at sea to show due regard for the safety of our ships," the statement said, adding Washington was prepared to hold discussions on such issues with Beijing. "Our Navy will continue to operate in international waters in accordance with customary international law and we expect China to exercise due regard for the safety of our ships," the statement said. The Impeccable is one of five Navy surveillance ships that probe the ocean to gather acoustic data in an effort to detect underwater threats. The craft was specifically designed to use underwater listening devices to augment the Navy's anti-submarine capability. China views almost the entirety of the South China Sea as its territory. Its claims to small islets in the region have put it at odds with five governments - the Philippines, Vietnam, Malaysia, Brunei and Taiwan. Beijing argues that any intelligence data gathering by foreign governments within its exclusive economic zone is illegal, although the US and other nations say only exploitation of economic resources such as undersea gas deposits is restricted. Tensions spiked between the two militaries in 2001 when a US spy plane and Chinese fighter jet collided in international air space off Hainan, killing the Chinese pilot and forcing the American plane to make an emergency landing at a Chinese air base. Occasional minor clashes have followed, none of which have led to a major crisis. The weekend altercation comes amid an overwhelmingly positive start to relations between China and the new US administration of President Barack Obama, with Secretary of State Hillary Rodham Clinton receiving a warm welcome during a visit to Beijing last month. Clinton's visit was followed by one from David Sedney, US deputy assistant secretary of defense for East Asian security affairs. That marked the first formal military dialogue between the People's Liberation Army and the US since China canceled or suspended nearly a dozen military exchanges with the United States last year in protest over a $6.5 billion US arms sale to Taiwan. Despite the positive momentum in ties, the US military remains wary of China's rapid military buildup, fueled by double-digit annual percentage increases in the defense budget. In a report on his visit on Wednesday, Sedney noted US worries about opaque Chinese defense spending, a weapons buildup across from rival Taiwan and arms sales to Iran that the Obama administration believes are hurting stability in the Middle East by fueling terrorism. Calls to China's Defense Ministry rang unanswered Tuesday.