BEIJING — The Pentagon on Saturday said that Beijing had agreed to return an underwater drone seized by China in international waters, an indication that the two countries were moving to resolve an unusual incident that risked sharpening tensions in the run-up to the inauguration of President-elect Donald J. Trump.

“Through direct engagement with Chinese authorities, we have secured an understanding that the Chinese will return the U.U.V. to the United States,” said Peter Cook, the Pentagon press secretary, using initials to refer to the Navy’s unmanned underwater vehicle.

Mr. Cook said the deal had been reached after the United States “registered our objection to China’s unlawful seizure of a U.S. unmanned underwater vehicle operating in international waters in the South China Sea.”

The Chinese authorities told American officials that they planned to return the drone, but the two sides were still working out where, when and precisely how the device would be handed back, said two Defense Department officials, both of whom would talk about the negotiations with China only on the condition of anonymity. One of the officials said the Pentagon expected the matter to be resolved in the coming days without further acrimony.