Representatives of the American and Iraqi armies are signing an agreement on the surrender of Camp Taji to the Iraqi armed forces.

The threat by Secretary of State Mike Pompeo seemed extreme. The United States would shutter its own embassy in Baghdad if Iraq didn’t rein in Shiite militia attacks on American targets.

The ultimatum late last month – which came with the promise of a “strong and violent” response if the attacks did not stop – was a stunning admission of weakness, analysts say. And it revealed the scale of the dilemma faced by the U.S. in Iraq, as it seeks to draw down American forces without appearing to be running away under fire from Iran-backed groups.

It’s a distillation of how the Trump administration is torn between its stated desire to halt America’s “endless wars,” from Iraq and Syria to Afghanistan, while also withdrawing on its own terms.

The U.S. threat to close up shop also risks making the fragile Baghdad government – buffeted already by the COVID-19 pandemic, shrunken oil revenues, political infighting, chronic corruption, and a year of public protest – even more vulnerable to influence from outside powers.

Mr. Pompeo’s ultimatum may have been issued only to encourage Iraqi Prime Minister Mustafa al-Kadhimi to take a firmer stand against Iranian influence, and do more to rein in the powerful militias. But it highlighted the challenge the White House is navigating between the oft-competing policies of imposing maximum pressure on Iran, which sees in Iraq an opportunity to strike back at the U.S., while simultaneously in Iraq trying to deter Iran.

Further evidence of its withdrawal dilemma: Despite the attacks, the Pentagon announced last month that it was cutting U.S. troop levels by nearly half to 3,000, due to “confidence” in Iraqi forces’ “increased ability to operate independently.”

The rocket and other attacks by Iran-backed militias have now eased, but few believe that U.S. deterrence has been established, or that an offer this week of a temporary truce by some key Shiite militias – including Kataib Hezbollah, which said a “conditional” cease-fire would depend on the U.S. providing a timetable for its “retreat” – is anything more than waiting out the American election cycle.

“The U.S. is trying to avoid defeat,” says Abbas Kadhim, head of the Iraq Initiative at the Atlantic Council think tank in Washington.

“They don’t want to show that they were defeated in Iraq, and were expelled, specifically because Iran has made it clear that their sense of victory would be accomplished by forcing all American forces out of Iraq,” says Mr. Kadhim.

US-Iraq tensions
The vast U.S. Embassy complex – the largest in the world, built to house 3,000 diplomats, but now operating with a skeleton crew due to both security risks and pandemic dangers – is reportedly already in the process of being shuttered.

The threat to close it was a gift to factions in Iraq and Iran that want the U.S. to depart.

“If Iran and its friends’ highest priority is to drive U.S. forces out of Iraq, and you tell them that if they continue to do these attacks, we will take the troops out and shut the embassy, what do you expect them to do, less or more of that?” says Mr. Kadhim. “It seems like an invitation to step these [attacks] up.”

The growth of dozens of mostly Shiite militias – and the overt Iranian backing of several of the most powerful, which operate beyond government command structures – has been an increasing source of tension between Baghdad and Washington.

Stopping those Iraqi militia attacks was a top priority of President Donald Trump when he held a “strategic dialogue” with Prime Minister Kadhimi, a former head of Iraqi intelligence, at the White House in August. The U.S. drawdown was discussed, and the Iraqi leader said afterwards that an American presence was still required in Iraq to help fight remaining Islamic State sleeper cells.

Known as the Popular Mobilization Forces (PMF), or Hashd al-Shaabi, the Shiite militias were formed in 2014 to help defend the nation as ISIS swept south from Syria, gobbling up a third of the landmass as the U.S.-trained Iraqi army disintegrated.

Since the 2017 defeat of ISIS, however, the PMF have broadened their influence in political circles, deepened their control of economic networks, and angered citizens for leading a crackdown on Iraqi protests that swept the country beginning last October. The heavy-handed measures included the use of snipers and disappearances, which left an estimated 700 dead, as well as the murder of opponents.

Those backed by Iran have increasingly targeted U.S. facilities and troops, forcing American commanders to consolidate their positions in response, at the expense of the anti-ISIS battle.

Far from deterrence
But Washington’s conundrum shows it is a far cry from “deterring” Iran, which U.S. officials claimed had been achieved by assassinating Iran’s powerful general, Qassem Soleimani, and Iraqi militia leader Abu Mahdi al-Muhandis in a pre-dawn Baghdad drone strike last January.

Indeed, the militia attacks on American targets continued, often in the name of revenge for the two dead commanders.

“It looks like the assassination of Soleimani and Muhandis was the last roll of the dice of a Trump policy, and an act of ultimate stupidity and folly,” says Toby Dodge, an Iraq expert at the London School of Economics.

“The idea it would somehow restore strategic deterrence has been blown out of the water. The idea it would shift the balance has been blown out of the water. The American footprint is small and getting smaller,” says Professor Dodge.

The warning to close the embassy signaled two things, he adds. First, it laid out a two-step process that culminated in a threat to use military force – and therefore a recalculation.

“The Iranians and their allies sat up and took notice and thought: ‘We’ve got until November, and then the transition. This man [President Trump] is unpredictable…. So, let’s put things on the back burner, we’ve got what we want,’” says Professor Dodge.

But second, he adds, the pressure on an ostensible ally in the prime minister “shows you how poor U.S. elite analysis of Iraq is,” because it is counterproductive to demand an unambiguous pro-American stance in a country where every politician has “felt the hot breath of Iran down their neck ever since ‘maximum pressure.’”

“The Iranians have been rather astute, and have waited the Americans out,” says Professor Dodge. “You could argue that the Americans have achieved some kind of deterrence by taking their football and going home, but that [shrinking American presence] somehow yields the territory you want to operate deterrence over to your enemies.”

Call for “strategic patience”
The threat to close the Baghdad embassy provoked a firestorm. Former U.S. Ambassador Ryan Crocker, who served in posts from Beirut to Baghdad to Kabul, called for “strategic patience” in Iraq, and told an Al-Monitor podcast that closing the embassy would be “incredibly irresponsible.”

“What we need to stop doing is blaming al-Kadhimi for a situation that he didn’t create but that we did,” said Ambassador Crocker. “It almost sounds as though we are looking for an excuse, now that we’ve pulled out most of our troops, to pull out our embassy as well.”

Others suggested closing the complex, which is “only slightly smaller than Disneyland” and features 20 office buildings, six apartment blocks, and cost $750 million, and instead buying something smaller and “commensurate with its actual mission, role, and influence in Iraq,” notes Steven Cook, a Middle East analyst at the Council on Foreign Relations.

“If the existing complex speaks to the arrogance of the past two decades, a new home for the embassy would symbolize American humility after a misbegotten invasion and occupation,” Mr. Cook writes in Foreign Policy magazine this week.

Yet military withdrawal would be “ultimately counterproductive,” he argues. “Leaving Iraqis to the dangers of the Islamic State and the will of the Iranians would only perpetuate Iraq’s weakness and instability, handing Tehran a strategic victory.”