Mike Pompeo addresses students at the American University in Cairo.Andrew Caballero-Reynolds / AP

During a visit on Thursday to the nerve center of the Arab world, Mike Pompeo declared that reports of America’s departure from the Middle East under Donald Trump had been greatly exaggerated, and that it was Barack Obama who had abandoned the region—to devastating effect.

And yet the irony is that while the conduct of Obama and Trump in the Middle East couldn’t be more different, they’ve in fact ended up engaged in the same struggle: to extract the United States from the Mideast morass.

The U.S. secretary of state accused Obama—who 10 years ago in Cairo famously sought “a new beginning” between the United States and a billion-plus Muslims—of grossly underestimating radical Islamist ideology, willfully ignoring the dangers of the Iranian regime, and mistakenly perceiving the United States as a “force for what ails the Middle East.” This, he argued in a speech at the American University in Cairo, harmed hundreds of millions of people across the region and the world as ISIS “raped and pillaged and murdered,” Iran “spread its cancerous influence,” and the Syrian government “unleashed terror” by gassing its people, all in the face of American timidity.

“We learned that when America retreats, chaos often follows,” Pompeo observed in the chaotic wake of his boss’s abrupt decision to withdraw American troops from Syria. But in wiping out the Islamic State’s caliphate in Syria and Iraq, exiting the Iran nuclear deal, and twice retaliating against Bashar al-Assad’s use of chemical weapons, he contended, the Trump administration is reasserting the United States’ “traditional role as a force for good” in the region.

Strikingly, however, observers on both ends of the U.S. foreign-policy spectrum saw parallels in Obama’s and Trump’s views on the hard limits to expending American blood and treasure in the Middle East. As Obama’s former Mideast adviser Philip Gordon told me, Trump in a sense represents not “a repudiation of Obama” but a “doubling down of Obama.” Mark Dubowitz of the Foundation for Defense of Democracies, a supporter of the Trump administration’s hard-line Iran policies, similarly characterized Trump as “Obama 2.0” in wanting to disengage militarily from the Middle East, though he cited as an exception Trump’s views on Iran.

Pompeo delivered his message of reassurance to Israel and the United States’ Arab partners in damage-control mode during a nine-nation tour of the Middle East. Just a few weeks ago, his boss blindsided those allies by announcing plans to yank troops out of Syria and leave others to mop up what remains of the Islamic State there, noting that the Iranians could “do what they want” in the country and that it was time for the United States to terminate its “Endless Wars” and “come home & rebuild.” Pompeo and National-Security Adviser John Bolton have since fuzzed up the timeline and the conditions under which U.S. forces will leave Syria, but leave they will, assuming the president has his way.

In another sign that the president isn’t exactly preoccupied with reasserting the United States’ “traditional role” in the Middle East, there is no U.S. ambassador in more than half of the countries Pompeo is visiting on this trip, including Egypt.

And there were still other indications: As Pompeo spoke, the president headed to Texas as part of his bid to wall off the southern border through a government shutdown. While some State Department officials helping Pompeo with his travels worked without pay, Trump was venting that he could finance the barrier with a fraction of what the United States spends on the war in Afghanistan (where he’s signaled that the next major U.S. military pullout could soon occur).

Trump is embracing the idea “that we can build a wall around the United States and we can keep out all of these threats, whether they come in the form of immigrants or they come in the form of terrorists,” Dubowitz told me. Meanwhile, his secretary of state is off in the Middle East telling allies, “The United States is not retreating behind walls, but in fact we’re going to be deeply engaged in the region and in the world.”

Obama’s 2009 Cairo address was exceedingly ambitious—an attempt to suture the deep wounds of George W. Bush’s war in Iraq. Before a packed auditorium at Cairo University, to rounds of applause and even a shouted “We love you,” the new American president expressed determination to remove U.S. soldiers from Iraq and eventually Afghanistan, resolve the Israeli-Palestinian conflict, enter into nuclear negotiations and perhaps a more positive relationship with Iran, and nurture democracy, human rights, and economic development in the region. It was a broad, demilitarized vision for U.S. engagement in the Middle East.

Then came the Arab Spring and its awful aftermath, which led Obama to overthrow a dictator in Libya, redeploy U.S. forces to fight ISIS, and wrestle with whether or not to authorize direct military intervention in Syria. (He ultimately declined to do so.)

Obama did strike a nuclear deal with Iran, but he didn’t manage to permanently draw down the U.S. military presence in Iraq and Afghanistan or make much progress on Israeli-Palestinian peace or transforming public opinion of the United States in the Muslim world.

When I asked Gordon, Obama’s top Middle East adviser from 2013 to 2015, how influential the Cairo address had been in shaping policy by the time Gordon arrived at the White House, he responded, “Not too much, honestly.” The remarks “reflected Obama’s instincts about the region and his desires,” Gordon said, but “I think he would be the first to admit that he wasn’t able to deliver that ‘new beginning.’”

By the end of his presidency, Obama had grown profoundly disillusioned with the Middle East. He darkly described the region to The Atlantic’s Jeffrey Goldberg as a drain on American lives, power, and attention to parts of the world (such as Asia) that were more vital to U.S. interests—rife with high-maintenance allies, dangerous tribalism, and intractable conflicts.

Gordon argued that the extent of Obama’s disengagement from the Middle East is often overstated. Still, Obama was intent on reducing the United States’ costs and commitments in the region and not getting “sucked into the Middle East.” And what Gordon found surprising about the 2016 election was that the policy pendulum didn’t swing back in the other direction, as it often does when the other party takes control of the White House. Instead, the pendulum swung even further toward disengagement from the region.

Faysal Itani, a Middle East expert at the Atlantic Council, pointed to one critical difference between the two presidents, which Pompeo also emphasized in Cairo: Trump’s return to a traditional conception of the United States’ regional allies and adversaries following Obama’s efforts, however limited in scope, to shake up these dynamics.

Obama and his advisers were at times critical of Sunni Arab partners such as Saudi Arabia and unwilling to grant blanket support to them in their rivalry with Shia Iran, Itani noted. Pompeo, by contrast, vowed in black-and-white terms in Egypt to “partner with our friends and vigorously oppose our enemies,” noting that the Trump administration had “fostered a common understanding with our allies of the need to counteract the Iran regime’s revolutionary agenda.”

“I think if you would ask the Gulfies and the Israelis today, they’d probably tell you they prefer a chaotic friend [in Trump] to a cold and methodical frenemy” such as Obama, Dubowitz told me.

Dubowitz said he gathered from discussions with officials during a trip to the Middle East in December that they recognize Obama and Trump as part of a “trajectory” and emerging “bipartisan consensus that we should be out of the Middle East” as a result of war fatigue in the United States and heightened great-power competition. (He attributes Sunni Arab states’ small but serious steps toward rapprochement with Israel to the understanding that Israel and its powerful military aren’t going away, as the U.S. might do.)

Arab leaders understand that “they may not be able to count on the United States going forward,” he told me. “They can read the National Security Strategy and National Defense Strategy as well as we can. They get a sense it’s about China, China, China.”

Or, as Trump might put it: The Wall, The Wall, The Wall, and maybe China, too. “I don’t want to be in Syria forever. It’s sand and it’s death,” Trump stated shortly before Pompeo jetted off to the Middle East, as the president boasted of how he had decimated ISIS and could now let Iran and Russia finish the battle. “I want to spend money in our country.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.