The walls of the US Embassy in Baghdad were still on fire and members of pro-Iranian armed groups were chanting threats outside, when Iraq’s prime minister tried to explain the situation to President Donald Trump.

“Iraq is between friends who are 5,000 miles away from us and a neighbour we’ve had for 5,000 years,” Prime Minister Adel Abdul-Mahdi said in a New Year’s Day telephone call with Trump, according to a close adviser, Abdul Hussain al-Hunain. “We cannot change geography and we cannot change history, and this is the reality in Iraq.”

Iraq is caught in a vise.

Many Iraqis were furious that the United States violated their country’s sovereignty by carrying out airstrikes on Iraqi soil. A spate of strikes in December killed at least two dozen members of a pro-Iranian Iraqi military unit, provoking the assault on the US Embassy.

A separate strike last week killed Iran’s top military commander, the deputy chief of a coalition of Iraqi militias and eight other people, leading to a vote by Iraq’s Parliament to expel US forces from the country and a counterstrike by Iran on two US military posts in Iraq early Wednesday.

But acceding to the political pressure to rid the country of US troops would be a “disaster” for Iraq, militarily and economically, a senior Iraqi official said.

The main mission of the roughly 5,200 US troops stationed at a handful of bases around Iraq is to help the country fight the Islamic State group. If they leave, the official said, it would not only hamper that battle but also have a host of knock-on effects, from the departure of troops from other coalition countries to dire financial hardship if, as Trump has threatened, the United States imposed economic sanctions.