What an unmanned U.S. Navy drone looks like. (U.S. Navy)

The Chinese government will return a U.S. naval drone seized last week in the South China Sea, the Pentagon said Saturday, in a move that promises to defuse heightened maritime tensions between the two Pacific powers.

Pentagon press secretary Peter Cook said that Beijing had agreed to transfer the “ocean glider,” a small unmanned vessel used to assess water conditions, back to the United States, but said details on how and when that would occur had not been decided.

The latest spike in U.S.-Chinese maritime tensions occurred Thursday, when a Chinese submarine rescue ship close to the USNS Bowditch, an oceanographic survey vessel operating about 50 nautical miles northwest of Subic Bay in the Philippines, took possession of the U.S. drone.

The incident occurred within sight of the Bowditch, which tracks the drone as it collects unclassified data on water temperature, salinity and other factors that may affect U.S. naval operations. According to U.S. officials, the Chinese ship refused initial requests from the Bowditch to return the drone.

“We have registered our objection to China’s unlawful seizure of a U.S. unmanned underwater vehicle operating in international waters in the South China Sea,” Cook said in a statement.

(Jason Aldag,Julie Vitkovskaya/The Washington Post / Satellite photos courtesy of CSIS)

“Through direct engagement with Chinese authorities, we have secured an understanding that the Chinese will return the [drone] to the United States,” he said.

While the seizure drew criticism from some U.S. lawmakers, statements from Washington and Beijing suggest that both sides are eager to avoid further intensifying tensions at a moment of deep uncertainty in U.S.-Chinese relations after the election of Donald Trump to the presidency.

Even as China asserts a right to areas of the South and East China seas also claimed by some of its neighbors, it has embarked on an ambitious program of constructing artificial islands, some of which appear to be intended as military outposts.

The U.S. military has conducted repeated shows of force, sailing ships or conducting surveillance flights near disputed areas, while also seeking to avoid any serious military escalation with a key commercial partner.

After the Pentagon announced that the drone would be returned, a U.S. defense official, speaking on the condition of anonymity to comment freely, said that the Obama administration was “glad to get it back and put this behind us.”

“It’s somewhat reassuring that senior leadership in Beijing agreed that this was something that should be returned, regardless of the individual actions of their people at sea,” the official said. It is not clear who authorized the seizure of the drone.

Those comments came after the Chinese Defense Ministry issued a statement saying the ­marine device had been taken in the interest of “safe navigation” in the area, according to a report from the Associated Press. The ministry also said the U.S. vessel would be returned “through appropriate means,” the AP reported.

The flap over the drone comes as Trump’s election generates concern among Chinese authorities, with the president-elect questioning long-standing U.S. policy on China and continuing his sharp criticism of Beijing’s trade and monetary policies.

Trump angered Chinese officials when he spoke by phone with the president of Taiwan, which Beijing considers a breakaway province.

While it is not clear how the Trump administration will handle efforts by China to assert itself in the South China Sea, his stance toward Beijing suggests a hard line.

On Saturday morning, Trump issued a tweet that said: “China steals United States Navy research drone in international waters — rips it out of water and takes it to China in unprecedented act.”

In a later Twitter message, the president-elect said: “We should tell China that we don’t want the drone they stole back — let them keep it!”