BAGHDAD — The U.S. government has decided to withdraw some staff from its embassy in Baghdad through the final weeks of the Trump administration, officials say, as tensions rise throughout the region.

A person familiar with the withdrawal described it as a temporary “de-risking” that will continue after the Jan. 3 anniversary of the slaying of senior Iranian military leader Qasem Soleimani last year by a U.S. drone strike in Baghdad. The individual spoke on the condition of anonymity to discuss security matters. The number of personnel to be withdrawn was unclear.

The State Department provided no official confirmation of the drawdown but said that ensuring the safety of U.S. government personnel and facilitates was its “highest priority.”

“The State Department continually adjusts its diplomatic presence at Embassies and Consulates throughout the world in line with its mission, the local security environment, the health situation, and even the holidays,” a department official said.

The department official said that U.S. Ambassador Matthew Tueller would remain in Iraq and that the embassy would continue to operate.

The decision comes as the Trump administration is increasing pressure on Iran and its allies in Iraq ahead of the political transition in Washington. President-elect Joe Biden is expected to move toward reviving a landmark nuclear deal between Iran and world powers that had offered Iran financial relief in return for limiting nuclear activities.

Tensions spiked across the Middle East on Friday after a prominent Iranian nuclear scientist, Mohsen Fakhrizadeh, was killed in a targeted attack in Tehran. Iranian officials have blamed Israel for the killing, raising the possibility that Iran or its proxies might retaliate against Western targets.

In Iraq, Secretary of State Mike Pompeo has used the threat of a full embassy withdrawal in pressuring Iraqi Prime Minister Mustafa al-Kadhimi to escalate his government’s crackdown on Iranian-backed militias in Iraq. The militias have repeatedly fired rockets at diplomatic and military sites used by Americans over the past year.

The United States began to reduce its embassy staffing in May 2019, ordering “non-emergency” government employees to leave Iraq because of the danger posed by rocket attacks. Since then, diplomatic facilities have operated with a smaller staff.

As tensions soared last year between the United States and Iranian-backed militias, the armed groups besieged the embassy for two days in December. Shortly after, President Trump ordered the drone strike that killed Soleimani and his closest Iraqi ally, militia leader Abu Mahdi al-
Muhandis, risking a further escalation.

During the embassy siege, the Pentagon deployed a special-
purpose crisis-response task force of Marines who are based in Kuwait to bolster security and made their presence plainly visible from outside. The unit, primarily composed of infantrymen, was formed after the 2011 attack in Benghazi, Libya, that killed four Americans, including U.S. Ambassador J. Christopher Stevens.

Last month, Trump told his advisers he is prepared to order a devastating response if any Americans are killed in attacks attributed to Iran, a senior official said.

The rocket attacks blamed on Iran-backed militias have killed three Americans and a Briton. For the most part, it has been Iraqi security forces of civilians caught in the crossfire.

The Trump administration also has been drawing down American troops in Iraq, six years after a U.S.-led coalition joined the fight against the Islamic State here. Those militants are largely defeated now, and for the most part it is Iraqi security forces who conduct airstrikes, raids and other operations against ISIS fighters.

The U.S. military is now reducing its presence in Iraq from about 3,000 to 2,500 by Jan. 15, following a directive by Trump last month. Future decisions will be made by the “next administration,” said Army Gen. Mark A. Milley, chairman of the Joint Chiefs of Staff.

He said Tuesday that the Iraqi government has indicated that it wants to keep a small U.S. military force in Iraq for some time to train and advise Iraqi soldiers, and that U.S. officials want to make sure that the Islamic State does not regenerate “at a relatively low cost.”

Correction: The story has been corrected to state that it has been six years since the U.S.-led coalition joined the fight against the Islamic State, not nine.

Hudson and Morello reported from Washington. Dan Lamothe and Missy Ryan in Washington contributed to this report.