CAIRO — Secretary of State Mike Pompeo delivered a scathing rebuke of the Obama administration's Mideast policies on Thursday, accusing the former president of "misguided" thinking that diminished America's role in the region while harming its longtime friends and emboldening Iran.

In a speech to the American University in Cairo, Pompeo unloaded on President Donald Trump's predecessor, saying he was naive and timid when confronted with challenges posed by the revolts that convulsed the Middle East, including Egypt, beginning in 2011.

Pompeo denounced the vision outlined by President Barack Obama in a speech he gave in Cairo in 2009 in which he spoke of "a new beginning" for U.S. relations with countries in the Arab and Muslim world.

"Remember: It was here, here in this very city, another American stood before you," Pompeo told an invited audience of Egyptian officials, foreign diplomats and students. "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. He told you that the United States and the Muslim world needed 'a new beginning.' The results of these misjudgments have been dire."

Pompeo said that the U.S. was "timid" about "asserting ourselves when the times — and our partners — demanded it."

The secretary did not mention Obama by name but the remarks still struck listeners in the U.S. as unusually partisan.

"It's a speech shocking for its use of domestic politics, for kind of attacking a prior president in an international setting and for going to a long-time ally and questioning some of the foundations of the relationship with the ally," said Heather Hurlburt, an analyst with the New America, a nonpartisan think tank. "Those are all things that secretaries of state don't normally do but seem to becoming standard practice with Pompeo."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Pompeo's speech came on the third leg of a nine-nation Mideast tour aimed at reassuring America's Arab partners that the Trump administration is not walking away from the region amid confusion and concern over plans to withdraw U.S. forces from Syria.

Former Obama administration officials rejected Pompeo's assertions as petty, political and weak. They said the speech pandered to authoritarian leaders and ignored rights violations that Obama had called out.

"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," National Security Action group, a group of former officials, said in a statement.

Rob Malley, who was Obama's national security council director for the Middle East and is now at the International Crisis Group, said hearing Pompeo's speech was like "like listening to someone from a parallel universe" in which the region's shortcomings were ignored.

"In that parallel universe, the Arab public probably will receive it enthusiastically," he said. "Back on planet earth, they will see it for what it is: a self-congratulatory, delusional depiction of the Trump administration's Middle East policy."

Pompeo blamed the previous administration's approach to the Mideast for the ills that consume it now, particularly the rise of the Islamic State group in Iraq and Syria and Iran's increasing assertiveness, which he said was a direct result of sanctions relief, since rescinded by the Trump administration, granted to it under the 2015 nuclear deal.

He said Obama ignored the growth of the Iranian-backed Hezbollah movement in Lebanon to the detriment of Israel's security and not doing enough to push back on Iran-supported rebels in Yemen.

Since Trump's election, however, Pompeo claimed this was all changing.

"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," he said. "Now comes the real 'new beginning.' In just 24 months, actually less than two years, the United States under President Trump has reasserted its traditional role as a force for good in this region, because we've learned from our mistakes."

In the speech entitled "A Force for Good: America's Reinvigorated Role in the Middle East," Pompeo extolled the Trump administration's actions across the region cementing ties with traditional, albeit authoritarian, friendly governments, taking on the Islamic State group in Iraq and Syria and imposing tough new sanctions on Iran.

"President Trump has reversed our willful blindness to the danger of the regime and withdrew from the failed nuclear deal, with its false promises," Pompeo said.

Since withdrawing from the nuclear deal last year, the administration has steadily ratcheted up pressure on Tehran and routinely accuses the nation of being the most destabilizing influence in the region. It has vowed to increase the pressure until Iran halts what U.S. officials describe as its "malign activities" throughout the Mideast and elsewhere, including support for rebels in Yemen, anti-Israel groups, and Syrian President Bashar Assad.

"The nations of the Middle East will never enjoy security, achieve economic stability, or advance the dreams of its peoples if Iran's revolutionary regime persists on its current course," Pompeo said.