Thirty-six years ago, a yellow Mercedes truck loaded with twelve thousand pounds of explosives sped into the barracks of U.S. Marine peacekeepers in Beirut. It was 6:22 A.M. Lance Corporal Eddie DiFranco, on guard duty nearby, was the only one who saw the bomber. “He looked right at me, smiled,” DiFranco said later. “Soon as I saw the truck, I knew what was going to happen.” The truck set off the largest non-nuclear explosion on Earth since the Second World War. The four-story concrete building imploded; marines were crushed like paper dolls. The collapse set off a brown mushroom cloud over the Lebanese capital. The thundering explosion woke up everyone, including me, as I was slumbering on a balmy Sunday morning. Two hundred and forty-one marines, most of them asleep because reveille was still eight minutes away, were killed. It was the largest loss of U.S. military life in a single incident since Iwo Jima. A special memorial was established at Arlington Cemetery for the victims.

“The Marine bombing was the Pearl Harbor of the Middle East,” Fred Hof, a former U.S. Army attaché in Beirut who investigated the bombing as part of the Long Commission, reflected this week. The attack—the deadliest of three suicide bombings against the military and two U.S. Embassies in Beirut over sixteen months—marked a turning point for American engagement in the region. Four months later, the United States opted to withdraw abruptly from Beirut. The collapse of that mission resonates, hauntingly, as U.S. Special Forces soldiers pull out of Syria now. Once again, the United States is hastily retreating—abandoning a mission, stranding allies, creating a vacuum for adversaries to quickly fill, enabling Islamic extremists, weakening American credibility globally, and leaving the Middle East, the world’s most volatile corner, even more unstable.

In each case, the Administration—Trump’s today, and Reagan’s in the early eighties—made expedient political decisions, irrespective of the long-term repercussions. “I hear some of the same tones out of the Trump Administration that I heard from the Reagan Administration,” the retired colonel Timothy J. Geraghty, the Marine commander in Beirut in 1983, told me. “You try to learn lessons, but here you are back in the same situation with the same players.”

“The ghosts of Lebanon are in Syria today,” Ryan Crocker, who was a young diplomat in Beirut in 1983 and later served as ambassador in Lebanon and Syria, told me this week. “Oh, the parallels.” In both cases, the U.S. intervened with the initial prospect, perhaps naïvely, of restoring stability after a flashpoint—the Israeli invasion of Lebanon, in 1982, or the rise of ISIS, in Syria and Iraq, in 2014—and of then building on it in broader efforts toward peace. When the going got tough, however, the U.S. retreated from both countries. And chaos erupted.

The language used by the Reagan and Trump Administrations, thirty-six years apart, is eerily similar. When the Marines withdrew from Lebanon, a senior State Department official told the Times, “We now have a new policy in Lebanon. It goes like this: Lebanon is a country that has been at war for a thousand years. We did what we could to bring some order to the place, but it is obvious that nobody there wants order, and so we’re . . . letting the Lebanese fight their own battles.” During the past week, Trump has scornfully dismissed the Middle East—a region with “a lot of sand”—for its endless wars. “They’ve been fighting for a thousand years. Let them fight their own wars,” he said in a joint press conference with the Italian President last week. “That’s the way it is.”

The twin retreats have also included feelings of betrayal—both the betrayal by the Commander-in-Chief of his own military on the ground and the betrayal by those forces of the people they had been deployed to help. “If you’re a motivated warrior and you’re giving your heart and soul, you feel like the politicians are selling you cheap—all the blood, all the wounds, internal and external, that have been sacrificed for a cause are suddenly worthless,” Robert Jordan, who was the Marine spokesman in Beirut in 1983, and who is still engaged in the military community, told me this week. “That’s how the Marines felt in Beirut. That’s how the S.O.F. forces feel as they withdraw from Syria now.” Because of “the President’s ill-considered move to pull our forces out of Syria,” U.S. Special Forces “didn’t even have time to say goodbye to the Kurds they were fighting alongside,” Crocker added. “It’s appalling.”

In both cases, the winners were the same—Russia, Iran, Syria, and extremist movements, Geraghty said. In the eighties, the Soviet Union exploited the U.S. pullout and the failure of the wider peace effort for its territorial and diplomatic gain. Today, Russia is exploiting the U.S. pullout to widen its influence in the region. On Tuesday, President Vladimir Putin signed an agreement with the President of Turkey, Recep Tayyip Erdoğan, to establish joint control of part of Syria that had been run by U.S.-backed Kurds in the Syrian Democratic Forces.

In uncanny ways, dictatorial rule in Syria was strengthened in both cases, too. In the eighties, Hafez al-Assad ruled in Damascus. The U.S. pullout from Lebanon reinforced his control at a time of unprecedented weakness. In 1982, a coup plot from within his air force had only been uncovered in its final phase. Assad had recently killed more than ten thousand people in Hama to put down an internal uprising led by the Muslim Brotherhood. And Israel had wiped out his air force during its invasion of Lebanon. The U.S. withdrawal allowed Assad to rebuild, with aid and arms from Russia, and restore his hold over Lebanon as well as over Syria.

Assad’s son Bashar has ruled in Damascus since his father’s death, in 2000. He has faced unprecedented vulnerability since a popular uprising, in 2011, disintegrated into an eight-year civil war. More than a half million people have died; more than five million have fled the country. And his country was dismembered, with the Kurdish-led and U.S.-backed Syrian Democratic Forces holding a third of the territory—including vital oil wells. The U.S. withdrawal allows the younger Assad to restore control over the whole country. With no other backers, the Kurds in the S.D.F. turned to the Assad government and its army to return to northeastern Syria.

Iran also gained ground, then and now. In the early eighties, its most ambitious foreign intervention after the 1979 revolution—dispatching some eighteen hundred of the Revolutionary Guards to Lebanon’s Bekaa Valley, even as it fought a grisly war with Iraq—won huge dividends. It fostered the birth of Hezbollah, which was blamed for the Marine bombing. The Shiite militia’s use of a suicide bomb in Lebanon has since become a standard tool of unconventional warfare by disparate jihadi movements across the Middle East—most notably ISIS and al-Qaeda. Creating a proxy in Lebanon was Iran’s first step in building an arc of allies and militias from Tehran, through Baghdad and Damascus, to Beirut. Iran’s influence now spreads all the way to the Mediterranean.