BEIJING — China said Saturday its military seized a US Navy unmanned underwater glider in the South China Sea to ensure the ‘‘safe navigation of passing ships,’’ but would give back the drone after determining it was an American device.
The United States later confirmed it had ‘‘secured an understanding’’ for the return, seeming to settle one of the most serious incidents between the two militaries in years.
The Chinese navy on Thursday seized the drone, which the Pentagon said was being operated by civilian contractors to conduct oceanic research.
The United States lodged a formal diplomatic complaint and demanded the drone be returned.
Chinese Defense Ministry spokesman Yang Yujun issued a statement late Saturday saying that a Chinese navy lifeboat discovered an unknown device in the South China Sea on Thursday.
‘‘In order to prevent this device from posing a danger to the safe navigation of passing ships and personnel, the Chinese lifeboat adopted a professional and responsible attitude in investigating and verifying the device,’’ Yang said.
The statement said that after verifying that the device was an American unmanned submerged device, ‘‘China decided to transfer it to the US through appropriate means.’’
The United States said that ‘‘through direct engagement with Chinese authorities, we have secured an understanding that the Chinese will return’’ the unmanned underwater vehicle, according to a statement from Peter Cook, spokesman for US Defense Secretary Ash Carter.
US officials said China’s ‘‘unlawful seizure’’ came in international waters.
Yet China pointedly accused the United States of long sending ships ‘‘in China’s presence’’ to conduct ‘‘military surveying.’’
‘‘China is resolutely opposed to this and requests the US stop such activities,’’ it said. ‘‘China will continue to maintain vigilance against the relevant US activities and will take necessary measures to deal with them.’’