The most predictable thing about President Trump’s semi-official decision Wednesday morning to order the removal of U.S. troops from Syria is the way it blindsided everyone from his own agency heads to America’s Kurdish allies in Syria. In what’s becoming something of a tradition, Trump declared his intention to head for the exits right after one of his senior officials—in this case Ambassador James Jeffrey, special representative for Syria engagement—gave a major speech in Washington declaring America’s ongoing commitment to the country. Although we’ve come to expect Trump to contradict his own foreign policy advisers, one aspect of his Twitter statement did stand out, the notion that defeating ISIS was the “only reason” for the U.S. presence in Syria:

We have defeated ISIS in Syria, my only reason for being there during the Trump Presidency. — Donald J. Trump (@realDonaldTrump) December 19, 2018

In his speech at the Atlantic Council this week, Jeffrey listed the defeat of ISIS (which has not yet been completed, for what it’s worth) as one of three goals for the U.S. in Syria. The others were a “changed regime in Damascus” and forcing “Iran … to get out of there,” meaning withdraw its troops and sponsored militias. National security adviser John Bolton put the last goal even more starkly in September, saying, “We’re not going to leave [Syria] as long as Iranian troops are outside Iranian borders and that includes Iranian proxies and militias.”

This goal is a recipe for a quagmire. Iranian forces are going to remain in Syria for the foreseeable future, which means U.S. forces would, as well. It’s also illegal. Congress arguably never authorized sending U.S. troops to Syria to fight ISIS, and it definitely didn’t authorize them to fight Iran.

That being said, a full U.S. withdrawal from Syria probably would be a boon for Tehran. As the Guardian notes, “A large US base at Tanf near the Iraqi border has been used as a buffer against Iranian proxies who covet the area as a land corridor linking Iran to Damascus. An evacuation of that base would signal a decision that maintaining that buffer was no longer a national security priority.” And while it’s been clear since before Trump took office that the U.S. has no intention of dislodging Bashar al-Assad’s regime, Iranian leaders will no doubt welcome the news that the U.S. isn’t even interested in pressuring Assad to make concessions.

Extreme hawkishness on Iran is one of the defining characteristics of the Trump administration’s foreign policy. In laying out the White House’s Iran strategy earlier this year, Secretary of State Mike Pompeo stopped just short of calling for regime change. But Trump often seems to be more a hawk of convenience, calling for confrontation with the Islamic Republic when it aligns with his other priorities.

Trump’s marquee foreign policy decision so far has been canceling the 2015 Iran nuclear deal. This was probably less because of what the deal actually accomplished—Even die-hard Iran hawks like Secretary of Defense James Mattis and former national security adviser H.R. McMaster, who opposed the original deal, argued for keeping it place.

Rather, Trump seemed intent on killing it because Barack Obama had negotiated it; because shredding it was a centerpiece of his campaign; because, in his blinkered understanding, it involved sending Iran barrels of American cash for nothing; and because it made his friends in Israel and Saudi Arabia happy.

On his first foreign trip in 2017, Trump was more than happy to stand before a crowd of enthusiastic Sunni autocrats and declare that “nations of conscience must work together to isolate Iran, deny it funding for terrorism, and pray for the day when the Iranian people have the just and righteous government they deserve.”

“Just and righteous” government for people in the Middle East has never been a core Trump priority—look at where he was giving the speech—and the president’s enthusiasm for the Saudi worldview probably had a lot more to do with the supposed billions in weapons deals he came home with.

It’s true that Trump cited the threat of Iran’s regional ambitions in his recent statement on why the U.S. was maintaining ties with Saudi Arabia and continuing to back the controversial war in Yemen, but the statement quickly pivoted to a boast about how Saudi investment would “create hundreds of thousands of jobs, tremendous economic development, and much additional wealth for the United States.”

On the other hand, Trump has long been skeptical about the need for a continuing U.S. troop presence in Syria, and it’s his advisers and senior officials who have framed that presence in terms of Iran. During negotiations about the nuclear deal with French President Emmanuel Macron last spring, Trump brought up the need to maintain a “strong blockage” between Iran and the Mediterranean. The idea is that Iran, with its sizable deployments and allied militias, as well as pliant government in Iraq, Syria, and Lebanon, has open access to the sea.

The idea clearly appealed to Trump, who has mentioned it several times, but now, seemingly on a whim, he’s willing to abandon the closest thing he has to an actual “blockage,” the presence of U.S. troops in Syria. In the wake of Trump’s decision, whether it is confirmed or not, U.S.-backed Kurdish forces in northeastern Syria will no doubt rush to cement their nascent relationship with Assad, further extending the Iranian-backed leader’s control over the country. Already, there have been indications of Kurdish troops fighting alongside Iranian-backed militias.

For many hawks in Washington, including on Trump’s own team, confronting Iran is an obsession, an organizing principle requiring massive resources and years of struggle. For Trump, it may just be a way to justify things he wants to do anyway.