ABU DHABI, United Arab Emirates — Secretary of State Mike Pompeo delivered a scathing rebuke of President Barack Obama’s Middle East policy in an address Thursday in Cairo that centered on exerting maximum pressure on Iran and doubling down on the United States’ alliances with Sunni autocrats and Israel.

In establishing his own vision for the Middle East, Pompeo set up the Obama administration as an example of what not to do, whether it was striking a landmark nuclear deal with Iran in 2015 or leaving Egypt’s autocratic president, Hosni Mubarak, in the lurch during that country’s protests in 2011.

“The United States has reasserted its traditional role as a force for good in this region,” Pompeo told an audience at American University in Cairo. “We’ve learned from our mistakes.”

The speech served as an explicit rebuttal of the address that Obama delivered in Cairo in 2009, which extended an olive branch to Iran and called for a two-state solution to the Israeli-Palestinian conflict. In that address, Obama criticized Israel’s settlement activity and underscored the suppression of political rights by Arab monarchies.

Pompeo’s criticism of the Obama administration’s “misguided” thinking included its hesitance to use military force and aggressively call out “radical Islam.”

“Remember: It was here, here in this very city, another American stood before you,” Pompeo said, referring to Obama. “He told you that radical Islamist terrorism does not stem from ideology. He told you 9/11 led my country to abandon its ideals, particularly in the Middle East.”

It is unclear what Pompeo meant by the abandonment of “ideals,” but Obama’s speech did take a stand against the use of “torture” to interrogate terrorism suspects, as well as detentions at the U.S. prison facility in Guantanamo Bay, Cuba. In terms of calling out radical Islamists, Obama’s address referred to the problem of “violent extremism” — a term that has been criticized by Republicans as an attempt to be “politically correct.”

Pompeo’s remarks prompted an immediate rebuttal from a group of mostly Obama administration officials, who called the address petty.

“That this administration feels the need, nearly a decade later, to take potshots at an effort to identify common ground between the Arab world and the West speaks not only to the Trump administration’s pettiness but also to its lack of a strategic vision for America’s role in the region and its abdication of America’s values,” the National Security Action group said in a statement.

Pompeo offered unconditional praise to Israel and credited countries such as Saudi Arabia and Bahrain for pushing back against Iranian aggression. He did not raise their human rights records, not mentioning the Saudi kingdom’s killing and dismemberment of journalist Jamal Khashoggi in October and the Bahrain government's suppression of its majority Shiite population.

Instead, he depicted those countries as victims of an Obama administration that was unwilling to stand proudly behind its allies. “The Trump administration has moved quickly to rebuild links among our old friends and nurture new partnerships,” Pompeo said.

While Obama’s 2009 address cautioned that the United States did not have the answers to all of the Middle East’s “complex” problems, Pompeo castigated that approach as insufficiently prideful.

“The good news is this: The age of self-inflicted American shame is over, and so are the policies that produced so much needless suffering,” Pompeo told an audience of Egyptian officials, diplomats and students.

Pompeo spoke amid confusion among U.S. allies over President Trump’s announced plan to withdraw U.S. troops from Syria immediately, a proclamation that was followed by remarks that the withdrawal will happen “slowly.”

Pompeo said the United States would continue airstrikes in the region “as targets arise” and continue its mission of overseeing the full defeat of the Islamic State and the expulsion of Iranian forces from Syria, a job that analysts said would take much longer than an initial 120-day U.S. timeline for withdrawal. U.S. officials say there is now no timeline for withdrawal.

Exerting pressure on Iran has been a cornerstone of the Trump administration’s foreign policy. The president withdrew from the Iran nuclear deal in 2018 and reimposed punishing sanctions on the Islamic republic despite opposition from key European allies. Pompeo has repeatedly called the country the “leading state sponsor of terrorism.”

“Iran does sponsor terrorism, but not the variety that tends to threaten the U.S. homeland,” said Max Abrahms, a terrorism expert and author of the book “ Rules for Rebels: The Science of Victory in Militant History.”

Pompeo’s outlook “is driven by his support for Israel,” Abrahms said. “Iran poses a major terrorism threat to Israel, much less so the U.S. homeland.”

To many of those listening, Pompeo appeared to have ignored decades of collective angst in the region toward the United States and its policies, seemingly rewriting historical perceptions.

“Clearly, when Pompeo insists that ‘America is a force for good in the Middle East,’ he’s not thinking about a local audience . . . which generally associates American foreign policy as being responsible for invasion and occupation, of supporting autocracy and occupiers,” H.A. Hellyer, a Middle East analyst with the Atlantic Council, said in a tweet.

In his remarks, Pompeo also lauded the improvement in relations between Arab states, such as the United Arab Emirates, and Israel. But few Egyptians accept Pompeo’s declaration that Arab attitudes toward Israel are changing. Most view Israel as an enemy that has usurped the rights and lands of Palestinians.

“In Egypt, we do not really talk about Iran,” said Nouran Hassan, 23, a senior studying political science at American University of Cairo who was in the audience. “We don’t consider it dangerous. For most ordinary Egyptians, Israel is their enemy ever since the 1950s.”

Pompeo’s visit to Cairo is part of a nine-country swing through the region designed to reassure Arab allies that the United States remains committed to the Middle East despite its planned withdrawal from Syria.

Earlier in the day, he met with Egyptian President Abdel Fatah al-Sissi, a former general whom Trump has praised but critics have accused of committing human rights abuses. In his talks with Egyptian officials, Pompeo said he discussed the need for the Sissi government to improve human rights and basic freedoms. But when asked whether there were any discussions about Americans being detained, as well as thousands of political prisoners, Pompeo declined to provide specifics, saying only that “we talked about the full panoply of human rights issues.”

Human rights activists said Pompeo was not forceful enough in his criticism of the Sissi government’s abuses. They also expressed concern that Pompeo’s strong support of Sissi and other Arab authoritarian leaders in the push to combat terrorism could embolden their governments to commit more abuses.

“We know what that means,” said Philippe Nassif, Amnesty International’s advocacy director for the Middle East and North Africa. “It means a tacit approval of tens of thousands of people swept under Sissi’s regime in Egypt under the pretext of terrorism charges.”

Raghavan reported from Cairo. Karen DeYoung and Carol Morello in Washington contributed to this report.