Iraq is now on its third attempt to choose a prime minister. Parliament has requested the government to expel American troops. The Trump administration’s economic war against Iran has strengthened hardline factions, which remain determined on revenge for the January assassination of Qasem Soleimani.

U.S. officials admit that deterrence against Iran and Iraqi militias has failed. After the third rocket attack by the latter on American bases, despite earlier retaliation by Washington, the Pentagon withdrew from six bases rather than respond again. However, Secretary of State Mike Pompeo proposed a military campaign within Iraq against Iranian-backed Iraqi forces.

Washington could find itself at war with both Iran and Iraq. It is time to bring home America’s forces.

US policy toward Iraq is cursed. In the 1980s the Reagan administration supported Saddam Hussein’s aggressive war against Iran lest the Islamic Republic triumph and gain regional hegemony. Convinced of US support, an emboldened Hussein next occupied Kuwait.

That led to the first Gulf War, after which Washington left troops in Saudi Arabia, which became one of Osama bin Laden’s chief grievances. The Bush I and Clinton administrations both imposed no-fly zones and sanctioned and bombed Iraq for various offenses, without changing its behavior.

President George W. Bush’s administration used the 9/11 terrorist attacks as a pretext for invading Iraq, which became one of America’s worst foreign policy disasters. The result: thousands of American dead, tens of thousands of wounded, hundreds of thousands of dead Iraqis in the ensuing sectarian war, and millions of Iraqis driven from their homes. The Christian community was destroyed, with religious minorities driven to Kurdistan and abroad.

Iran’s influence was greatly enhanced by creation of a Shia-dominated government in Iraq. Al-Qaeda in Iraq morphed into the Islamic State, which made a dramatic return in 2014, taking over much of the country. At which point the Obama administration sent US forces back to Iraq. American troops were forced to cooperate with Iranian personnel and Iraqi militias backed by Tehran to defeat ISIS in December 2017.

Why are US forces still occupying Iraqi territory?

It isn’t to stop the Islamic State. The philosophy/theology remains attractive to some and like-minded fighters could reappear to do damage. However, Washington broke the movement at the height of its power; a permanent occupation is not necessary. An ISIS revival is opposed by Iraq, Syria, Jordan, Iran, the Gulf States, and Israel, with support likely from Russia and possibly from European states. All these governments have far more at stake in preventing a radical recrudescence.

The Trump administration’s real target is Iran, upon which the president is fixated. However, Tehran poses no threat to America. Of course, Saudi Arabia would be happy to fight to the last American, but the last place Washington should be is in the middle of a Sunni-Shia conflict. The Islamic State also is opposed by most countries in the region, including Turkey, Saudi Arabia, the leading Gulf States, and Israel. They are capable of deterring Iran.

Moreover, Iraq is no ally against Tehran. Baghdad’s relationship with Iran remains close: the two most important majority Shia states have strong personal, cultural, commercial, and religious ties. Iranian forces, led by Soleimani, played an important role in helping Baghdad defeat the Islamic State.

The Iraqi militia Kataib Hezbollah has a strong incentive to attack the US, which killed its founder, Abu Mahdi al-Muhandis, in the drone strike on Soleimani. Other groups would be happy to assist KH. Explained the Washington Post: "Iran-backed militias are becoming more audacious in attacking US personnel in Iraq, with rocket strikes against military bases occurring more frequently and, for the first time, in broad daylight. US officials say they are receiving near-daily reports of ‘imminent’ attacks planned against U.S.-linked military or diplomatic facilities."

After rockets hit Camp Taji last month the administration assumed KH’s culpability and retaliated, killing Iraqi policemen and soldiers who shared a base with the militia. Then came another two rounds of rocket attacks. Washington’s response: pull out of six facilities – retreat and appeasement in the usual lexicon of hawks – and demand that Baghdad do something.

Which is a forlorn hope.

Attacking Americans is easy sport and attracts both Sunnis and Shiites. Blame can be assumed but rarely proved. A new group, which may or may not be a front for KH, claimed responsibility for the latest attacks. Iran has influence, not control. David Schenker, Assistant Secretary of Near Eastern Affairs, said these groups continue to pose a "significant" threat to US personnel. So much for the promised restoration of deterrence.

Expecting Baghdad to choose between America and Iran won’t yield the answer Washington wants. No doubt, most Iraqis do not want their country to be a battleground or anyone’s puppet. Some, perhaps many, officials privately want to keep the US in Iraq – lots of countries prefer to turn their defense over to America.

However, contacts between Iranians and Iraqis are strong, broad, and pervasive. Moreover, Tehran’s embrace is tight and can be deadly. An anonymous Iraqi military official told the Washington Post: "No judge will issue an arrest warrant against a senior militia member if he wants to stay alive." He added: "We can’t stop them" from attacking US troops.

The "strategic dialogue" demanded by Washington, expected to start in June, won’t change the political dynamic on the ground. A hostile caretaker premier remains in office. The latest nominee for prime minister, Mustafa al-Kadhimi, has the reputation of maneuvering carefully between Washington and Tehran. He reportedly received support from Shia factions after he agreed not to restrict the militias. Moreover, his first task, if confirmed by parliament, will be to organize elections. He is unlikely to welcome America’s continued presence or confront the anti-American militias.

But will the administration accept anything other than an unambiguous yes? After having denounced "endless wars," President Trump threatened to sanction Baghdad if the government enforced parliament’s resolution, which would destroy the bilateral relationship. Worse would be attacking more Iraqis in Iraq without the Iraqi government’s approval. Violent resistance almost certainly would multiply. Striking Iran would greatly expand the conflict. Despite America’s undoubted military power, Tehran has demonstrated that it could utilize friendly forces and asymmetric tactics – remember the drone strikes on the Saudi oil facilities – to harm American forces and allies throughout the Middle East. Setting the region on fire would be madness.

Washington should not stay in Iraq. The Middle East has been unstable for years while its importance to America has greatly diminished. It is time to leave Iraq and its neighbors to find a way to live together in the future without a US military presence.

Doug Bandow is a Senior Fellow at the Cato Institute. A former Special Assistant to President Ronald Reagan, he is author of Foreign Follies: America’s New Global Empire.