January marks the 25th anniversary of the first Gulf War. Many in the military look back on Operation Desert Storm with nostalgia. Objectives were limited, clear and achievable. Assumptions were rational. There was no mission creep. It was the perfect all-American war. On to our television screens were beamed real-time coverage of shock and awe. Big bombs. Obvious enemies. It lasted days not years. And it appeared at the time to produce a clear win.

Over the last quarter century, the US has repeatedly tried to “solve” the problem of Iraq so that we can walk away; but in so doing, we have set the conditions that have caused us to keeping being pulled back in.

During the Iran-Iraq war of 1980–88, we had supported Saddam Hussein against Iran, supplying him with economic aid, intelligence, weapons, and dual-use technology. And turned a blind eye when he gassed Iranians and Kurds.

But Iraq became our enemy when Saddam invaded Kuwait in 1990. Fearing he would not survive the financial crisis caused by the Iran war, Saddam annexed Kuwait (which many Iraqis considered a natural part of their country severed by the British when it had carved up the Ottoman Empire), calculating that it would be a short and easy war in which he would extract resources — and concessions — from other Gulf states. Saddam assumed that there would be no international military response. How wrong he was — particularly since our oil supplies were threatened.

Operation Desert Storm heralded in a new era. It was our first post-Cold War conflict — and a defining event for US global leadership. The American people had recovered from “Vietnam Syndrome.” The war ended with Iraq’s defeat on the battlefield, its humiliating withdrawal from Kuwait, and its international isolation. The US further gained a permanent presence in the Gulf, with bases in Kuwait and Qatar and the 5th Fleet in Bahrain.

But Saddam declared victory in the “mother of all battles” as he remained in power.

Ironically, Osama Bin Laden would later cite the deployment of US forces to Saudi Arabia — the guardian of the two holy Muslim shrines of Mecca and Medina — as one of his main grievances against the US. He had offered his own “Afghan Arabs” to help Saudi Arabia defend itself against Iraqi aggression — an offer that the Saudi monarchy rejected. Bin Laden attacked the “far enemy,” the US, in order to bring about the fall of the “near enemy,” the corrupt regimes of the Middle East, which he believed were propped up by the US.

For the next decade, the US pursued a policy of “dual containment” to isolate both Iran and Iraq politically, economically, and militarily. Working through the UN, the US organized a regime of economic sanctions, oil embargoes, and weapons inspections to weaken the regime so that it would not be a threat to regional security. But sanctions had a devastating effect on Iraqi society, destroying the middle class, and leading to the deaths of up to half a million Iraqi children. And Saddam was able to cement his control over society with the Baath party policing the rationing system and controlling imports and exports.

9/11 changed the entire political landscape of the world. It also provided the pretext to invade Iraq. On the election of President George W Bush, neo-conservatives had been appointed to prominent positions in his government. They had been advocating for a reorganization of foreign policy around unilateralism, military supremacy, and preemption in a changing post-Cold War environment. Influenced by Iraqi exiles, they promulgated a view that the removal of Saddam and introduction of democracy would transform the Middle East and bring about regional peace with Israel. Iraq’s violations of UN resolutions were used as the legal justification for the war against Iraq. Saddam was portrayed as an imminent threat due to his supposed continued possession of weapons of mass destruction — this proved to be a massive intelligence failure. Intelligence was cherry-picked in order to show a linkage between al-Qaeda and Saddam — claims that the intelligence community did not believe.

The US-led coalition overthrew Saddam’s regime in 2003, and replaced it with a government that we believed would be friendly to us. We botched our experiment with nation building, collapsing the state and creating anarchy rather than a better order. Those we excluded from power sought the demise of the new regime. And those we empowered used the country’s resources for their own interests, subverted the nascent democratic institutions we introduced, and deployed the security forces we trained and equipped to intimidate their rivals.

A ray of redemption appeared during the Surge. For once, we had the right strategy, leadership, and resources. The US military changed its tactics to focus on population security, outreach to insurgents, and precise targeting of those deemed irreconcilable. We helped bring about a shift in the strategic calculus of the various groups on the ground. We brokered ceasefires and truces between Iraq’s competing groups. And the violence dramatically declined.

On becoming President in 2009, Obama was determined to make good his election promise to end America’s war in Iraq. But instead of upholding the 2010 election results, brokering a deal among the elites, and ensuring the peaceful transfer of power, the Obama administration tried to maintain the status quo and to keep Nuri al-Maliki as premier, in the mistaken belief that he was our friend.

Secure in his seat for a second term, and now with the backing of Iran who was always conspiring to ensure the failure of the US project in Iraq, Maliki accused Sunni politicians of terrorism and drove them out of the political process; he reneged on his promises to the tribal leaders the US military had supported who had fought against al-Qaeda in Iraq; and he arrested Sunnis en masse. Sunni protests were violently crushed. Such an environment enabled ISIS to rise up out of the ashes of al-Qaeda in Iraq, presenting itself as the defenders of Sunnis. And many Sunnis determined that ISIS was the lesser of two evils when compared with the Iranian-backed regime of Maliki.

And Barack Obama became the fourth president to order airstrikes on Iraq, following in the footsteps of George H.W. Bush, Bill Clinton, and George W. Bush.

The Iraq war changed the balance of power in the region in Iran’s favor, exacerbating regional rivalries and leading to support for extremist groups in different countries, turning local grievances over poor governance into proxy wars.

Sectarianism has been inflamed by the Iraq war, followed by the civil war in Syria, and now the Iran nuclear deal. Iran seeks to spread its influence and to overturn the old order. It stands to benefit greatly from the nuclear deal, reintegrating itself into the international order the improving its economy through the lifting of sanctions. Saudi Arabia is fearful that it is losing its leadership position in the region, that Iran is destabilizing Saudi’s neighbors, and that the US is abandoning its traditional allies. In addition, the drop in the price of oil is causing economic woes in the region.

Iraq and the Middle East are extremely complex. The next President might reflect more deeply on the last quarter century in order to understand the modern struggle between different groups for power and resources in an environment where the legitimacy of regimes is contested, and in the midst of a geopolitical struggle between Iran and Saudi, who both instrumentalize religion to mobilize support. The next President might also consider how the first Gulf War heralded a new era of a US-led unipolar world; and how the second Gulf War ended that era, gave rise to ISIS and the collapse of the post WWI regional order, and transformed Iraq from a buffer state into an Iranian client state.

After 25 years, the US needs to recover from “Iraq Syndrome” and to better understand where and how we can have influence — as well as the unintended consequences of both our actions and non-actions. There are opportunities as the US is no longer dependent on Middle Eastern oil; and a young population in the region yearns for dignity and better governance.

The next President might seek to grow our reputation as a reliable ally, more strategic in the use of our diplomatic and military power, more appreciative of relationships and coalitions, more capable of being balancer-in-chief in the region, more supportive of strengthening institutions rather than individuals, and more willing to build bridges with people rather than prop up dictators. Importantly, the next President should remember that alliances change, identities evolve, and memories linger.