Since Friday, when the U.S. killed Iranian general Qasem Soleimani near Iraq’s only international airport, Baghdad and Washington have, on the outside, remained locked in a bitter diplomatic feud. Iraq’s parliament voted on Sunday that U.S. troops should end their ISIS-fighting mission in the country. Since then, President Donald Trump has repeatedly threatened to impose harsh economic sanctions on the country if it ejects American troops.

On Monday, Mahdi publicly declared that U.S. troops were confined to base, limited to “training and advising” only, and his office released a statement that he’d told the U.S. ambassador to Baghdad that both countries needed to “implement the withdrawal of foreign forces”, even as Trump administration officials try to stave off the expulsion behind the scenes.

But privately, Iraqi Prime Minister Adel Abdul Mahdi has been trying to slow-roll the American departure, Iraqi advisors say, fearful not just of Trump’s threatened sanctions, but of the departure of Western investment along with the foreign troops, and a resurgence of the so-called Islamic State without U.S. assets to hunt it.

“No real discussion has taken place as to the speed and scale of the withdrawal, or whether a full withdrawal will take place,” a senior Iraqi official told TIME. “At worst, we need to agree to an amicable divorce, in which we keep having a workable relationship thereafter. Otherwise we both lose out big time.”

After Iran’s supreme leader vowed to avenge Soleimani’s death hours after the strike, U.S. forces are curtailing counter-ISIS operations in Iraq in order to defend U.S. facilities against possible Iranian-backed retaliatory attacks, and U.S. diplomats are weighing a slight drawdown of personnel until the worst passes, with little trust that Iraqi security forces will protect them after the U.S. embassy in Baghdad was attacked on New Year’s Eve, a senior administration official told TIME.

“There’s nobody we can work with in the (Iraqi) government right now,” the official said. “We want to be there, but if nobody on the other end wants our help, we’ve got to make a decision as to whether to keep our people there.” (A State Department official would not confirm the deliberations, adding, “We are always evaluating our personnel posture.”)

U.S. military officials had to tamp down a flurry of reports a U.S. troop drawdown would begin shortly after a letter leaked to the media from U.S. Marine Brigadier General William Seely in Baghdad, advising the Iraqi government that he would be “repositioning forces…in the coming days and weeks to prepare for onward movement” in deference to the Iraqi Parliament’s vote. “We respect your sovereign decision to order our departure,” he added. Chairman of the Joint Chiefs Gen. Mark Milley told reporters the letter was a draft sent in error, and that troops are not leaving.

A senior U.S. military official said that while contingency planning is underway for a withdrawal if the Iraqi government eventually demands it, U.S. troops simply can’t draw down in the immediate future due to Iran’s current threats of retaliation. “Any reduced military presence in the foreseeable future would be untenable given the Iraqi military’s inability to protect the bases that house our people, even if they’re willing to do so,” the official said.

Mahdi, too, is trying to slow down the car crash, privately weighing options that would see only some U.S. troops withdraw, or extend the drawdown over a long period of time, says an Iraqi official who advises the prime minister. “The Parliament wants to eject coalition troops fighting against (ISIS)…but not specialized people who came to help the Iraqi security apparatus by training them,” the advisor told TIME Monday.

Mahdi had already artfully thrown a bureaucratic wrench in the works on Sunday, essentially disqualifying himself from carrying out the removal orders. Just after he won the Parliament’s approval to remove all 5,200 U.S. troops Sunday, he then asked the lawmakers to do something they haven’t been able to pull off since he resigned from his post last fall: replace him with a new prime minister.

It was a classic delaying tactic designed to buy time for tempers to cool, says Kenneth Pollack, a former CIA officer based in Iraq who is now a resident scholar with the American Enterprise Institute. “The leadership — starting with Mahdi but not limited to him — are trying to figure this out to roll it back so it takes months or years… That said, we’ve got two rounds coming up that are hugely determinative: what Iranians do and how Trump reacts to whatever they do.”

Mahdi’s private backtracking shows he’s painfully aware of the country’s fragile economic state, which fueled months of Iraqi protests that prompted him to resign in the fall, and led him to occupy his current caretaker role.

Any public warming or repair of the damaged U.S.-Iraqi relationship, however, may have to wait for Iran to respond for the drone strike that killed Soleimani, who commanded Iran’s elite Quds Force. Iraq’s Shia majority is furious over the killing of the man who brought them weaponry and military advisors to keep ISIS from marching south through Baghdad in 2014, while the Obama administration dithered. “Until Iran responds…none of the Shia leaders either wants to or dares to call for repairing relations with the U.S. or for U.S troops to remain,” says Rend Rahim, a former Iraqi Ambassador to the U.S. who now heads the Baghdad-based nonprofit Iraq Foundation.

Still, he’s not the only one exhibiting signs of “quick to anger, repent at leisure” regret: Video was leaked of Iraq’s Sunni Parliamentary Speaker Mohammed al-Halbousi warning the largely pro-Iran Shi’ite majority in Parliament that they would be blamed if Iraq’s economy slides into the abyss for choosing to oust U.S. troops in retaliation for Soleimani at their own economy’s expense. Even firebrand Iraqi cleric Muqtada al-Sadr reversed his calls to all Iraqis to take up arms against the Americans, stating only a day later that all diplomatic options should be exhausted first.

Trump’s steady drumbeat of tweeted and spoken insults and sanction threats are not helping relations get back on track. Rahim, the former Iraqi Ambassador, said the sanctions threats have only “made the situation worse.” The senior U.S. military official said they “complicated” the behind-the-scenes effort to persuade the Iraqis to reconsider their plans. “Call what the Embassy is trying to do damage control,” the official said.

The Iraqi official who advises Mahdi said Trump’s salvo on Sunday that Iraq must pay the U.S. back for improvements it made to Al Asad Air Base, which actually belongs to Iraq, also infuriated Iraqi officials. “The PM is under huge pressure…Trump is making it harder for for him,” he said.

Others agree. “It’s not our base. It’s theirs,” Pollack said. “We made improvements to their base, as part of the ISIS fight. That is so insulting to Iraq sensibilities.”

Administration officials acknowledge that Mahdi’s position, caught between his next-door neighbor and its potent allies on his turf and the U.S., has grown more difficult in light of the attack on Soleimani and Trump’s sanctions threat.

Mahdi will “tilt toward Tehran”, in the words of a former senior U.S. intelligence expert on Iran, especially given the lack of European support for Trump’s Iran actions. The official said: “If you were Abdul Mahdi, which way would you turn, toward the neighbor who invented chess or a temperamental Twitter addict halfway around the world?”

Some Iraq watchers say that if Iran does win this tug of war for Iraq’s future, that will ultimately suit Trump just fine. “We don’t want to stay…so that’s why we took that risk,” says Michael Knights, a scholar with the Washington Institute for Near East Policy, who has met with Iraq’s top leaders since 2003. “We see our mission being as degraded and the country’s leadership being completely unresponsive to our concerns.”

U.S. and coalition officials had petitioned Mahdi repeatedly to rein in the country’s Popular Mobilization Forces, most of them Shi’ite militiamen aligned with Iran, and led by Abu Mahdi al-Mohandes, the Iraqi deputy commander who was killed along with Soleimani. Mahdi had tried unsuccessfully to rein in al-Mohandes — known as “the Engineer” — and his militias. The armed fighters technically answered to the prime minister, but al-Mohandes enjoyed hero status among the Iraqi people for his role in defeating ISIS. And his backing by Iranian general Soleimani meant al-Mohandes could essentially do as he pleased.

It was al-Mohandes’ forces — groups like Asab al-Haq and Kata’ib Hezbollah — that conducted 11 rocket attacks against U.S. troops and personnel on Iraqi bases over the last two months. The groups also trafficked Iranian personnel, money and weapons, including mid-range missiles across Iraq, at Soleimani’s behest, U.S. and Iraqi officials say.

That lead to at least two strikes by Israel last year against the lethal Iranian aid, including bombing missiles stored on a militia base in northwest Iraq last May. An angry Iraqi prime minister ordered an investigation into the strikes, convinced Washington had approved them. U.S. officials shared commercial satellite imagery with Mahdi, showing him that the militia groups had buried whatever munitions had survived the Israeli action, and suggested the prime minister investigate what Iran was smuggling. Mahdi’s investigations team did try to access the base, but were turned away twice in a demonstration of how little power the prime minister had over what had become essentially a parallel power structure within Iraq.

That long-running friction between U.S. and Iraqi officials over militia activity eventually convinced U.S. officials that Mahdi was unwilling or unable to stop attacks on U.S. interests, including a recent rocket attack on a military base in Iraq, which killed an American contractor and injured four U.S. service members working to fight ISIS. That led to the Trump administration strikes on Iraqi militia bases and the subsequent attack by Kata’ib Hezbollah on the U.S. Embassy in Baghdad on December 31st.

U.S. officials complained to Iraq that it took roughly 24 hours for the prime minister to personally scramble Iraqi forces to defend the protestor-besieged embassy, which was hit by volleys of rocks and Molotov cocktails, an Iraqi official says, and the senior Trump administration official confirmed. All officials spoke on condition of anonymity to discuss the fraught conversations. Al-Mohandes was among the protestors on New Year’s Eve, apparently countermanding Mahdi’s orders and keeping the violence going.

U.S. diplomats told the Iraqi government that its embassy security teams were within minutes of switching to live fire against the protestors, when Iraqi special forces finally appeared. There was no loss of life, but three of the embassy’s main gatehouses were all but destroyed, and have now been mostly barricaded by stacked shipping containers to keep those inside safe.

“This one missed us, but they are getting closer,” the official said. “We are absolutely braced for it to happen again.”

—With reporting by John Walcott/Washington

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.