AMMAN, Jordan (AP) — On a recent evening, two of Jordan's top pro-al-Qaida ideologues held court on the rooftop of a villa decorated with strings of lights. Sporting shaggy beards and robes, the Muslim preachers whispered to each other and rose occasionally from plastic chairs to greet supporters.
It would have been hard to picture such a scene just a few months ago, with Abu Qatada and Abu Mohammed al-Maqdisi then being held in Jordanian prisons on security charges. But Jordan's priorities appear to have shifted because of the mounting threat posed by the Islamic State group, an al-Qaida offshoot that has seized large areas of neighboring Syria and Iraq, sending shivers through the kingdom.
Abu Qatada and al-Maqdisi have denounced some of the group's practices as un-Islamic — comments some analysts say have turned the preachers into assets in Jordan's campaign to contain the Islamic State, which is believed to have attracted thousands of followers in the country. Authorities say their release from prison — al-Maqdisi in June and Abu Qatada after an acquittal last week — had nothing to do with politics.
But the clerics' outspokenness points to one of many ways in which the rise of the Islamic State group is upending old assumptions in the Middle East.
At the core of the issue: the group is viewed by some regional players as an existential threat and the fight against it has created an unlikely mix of allies and reshaped regional priorities.
Longtime foes such as the United States and Iran now find themselves fighting a common enemy, as do Iraq's Arabs and Kurds — who rarely agree on much. Squabbling Arab states, such as Qatar and its Gulf neighbors, have at least temporarily put aside their differences in the fight against the militants.
One-time rivals "view the Islamic State through a similar lens, that it represents a threat to their national security interests," said Fawaz Gerges, a London-based expert on Islamic movements.
"This tells you the extent to which the Islamic State has really reconfigured regional security and global security," he added.
The coalition has quickly grown since the U.S. first launched airstrikes against Islamic State targets in Iraq on Aug. 8, followed by bombardments in Syria that began Sept. 21.
Saudi Arabia, the United Arab Emirates, Bahrain and Jordan have participated in attacks in Syria, while Qatar hosts an air base used by the coalition. France, the Netherlands, Denmark, Belgium and Britain are among European countries contributing to U.S. efforts to hit the Islamic State group in Iraq.
President Barack Obama acknowledged that U.S. intelligence agencies underestimated the threat from Islamic State militants in the Middle East and overestimated the ability and will of Iraq's army to fight such extremists.
Obama described the U.S. intelligence assessments in response to a question during a CBS "60 Minutes" interview broadcast Sunday. Obama also conceded that the U.S.-led military campaign in Syria was helping Syrian dictator Bashar Assad, a man the U.N. has accused of war crimes.
But Obama said he had no choice but to order U.S. airstrikes on Assad's enemies, including the Islamic State, because "those folks could kill Americans."
Just a year ago, the Obama administration appeared on the verge of striking government targets in Syria after blaming Assad for a deadly chemical weapons attack on rebel-held areas outside Damascus.
Syrian Foreign Minister Walid al-Moallem said Monday his government is satisfied with the U.S.-led bombing campaign, but that airstrikes should be expanded to include all other militant groups in Syria.
In an interview with The Associated Press, al-Moallem said the fight has aligned Damascus with its Western and Arab opponents in confronting the same enemy.
"We are fighting ISIS, they are fighting ISIS," he said, referring to the group by one of its acronyms.
Saudi Arabia and Qatar, among the most active supporters of the armed opposition seeking to topple Assad, are now part of the coalition that appears to be helping him militarily, even if unintentionally. How long they are willing to do so is unclear.
Qatar's participation in the coalition is significant. It has been under mounting political pressure over its backing of Islamist groups such as the Muslim Brotherhood, its ties with Hamas, which fought a 50-day war with Israel this summer, and for not doing more to stamp out private funding for extremist groups.
It now finds itself allied with three Gulf neighbors who pulled their ambassadors from the country earlier this year to protest Qatar's perceived regional meddling and support for Islamists. While the diplomats haven't been formally reinstated, it appears the Islamic State threat is now a more pressing concern.
"This is helping to push the GCC (alliance of six Gulf states) together against the Sunni extremists in Syria," said Theodore Karasik, an analyst at the Dubai-based Institute for Near East and Gulf Military Analysis.
Jordanian government spokesman Mohammad al-Momani predicted a long fight against the Islamic State militants.
"They have been trying to infiltrate into our borders, and therefore the threat is there," he said. "We will continue until we achieve our objective of degrading and finishing the terrorist organization."
The new counterterrorism fight isn't prompting the Obama administration to ease efforts against other long-term threats to the United States. Washington is still pushing for a nuclear deal with Iran and targeting the financing of Hezbollah and Hamas.
But shifting the priority to destroying the Islamic State group is creating new opportunities for indirect collaboration, even with sworn enemies.
U.S. and Iranian officials have held discussions on counteracting the Sunni extremists, although they deny direct cooperation.
In a sign of the overlap of Iranian and U.S. interests, Iran last week said one of the Islamic Republic's most senior generals and 70 Iranian soldiers helped Kurdish fighters defend Irbil, the capital of the autonomous Kurdish region in northern Iraq that has been a focus of the American military. The city is home to a U.S. consulate and offices of numerous Western companies, and the approach of Islamic State militants to its outskirts prompted American airstrikes in August.
Lebanon's powerful, Iranian-backed Shiite Hezbollah militia has used the threat posed by the Islamic State to justify fighting in Syria, alongside Assad's forces. After sending fighters to Syria last year, Hezbollah had faced mounting criticism at home that it was dragging the country into the civil war there.
Hezbollah leader Hassan Nasrallah now argues that Hezbollah's actions have prevented Islamic State militants from overrunning Lebanon.
The new regional climate also helped refocus Egypt's relations with the West on the issue of terrorism, a conversation President Abdel-Fattah el-Sissi appears more comfortable with than Washington's concerns about human rights violations resulting from his domestic crackdown on the Muslim Brotherhood.
El-Sissi deposed an elected president from the Brotherhood last year and has tried to portray his move against the group as a model for fighting terrorism. Washington remains critical of Cairo, but observers believe the ties between the two are improving.
Some in the Arab coalition say they are engaged in an existential battle.
"What we are fighting is not just a terrorist organization, but the embodiment of a malicious ideology that must be defeated intellectually," the vice president and prime minister of the Emirates, Dubai ruler Sheik Mohammed bin Rashid Al Maktoum, wrote in an opinion piece Sunday.
"I consider this ideology to be the greatest danger that the world will face in the next decade," he said.
Schreck reported from Dubai, United Arab Emirates. Associated Press writers Bassem Mroue and Diaa Hadid in Beirut, Bradley S. Klapper in Washington, Zeina Karam at the United Nations and Maggie Michael in Cairo contributed to this report.
Follow Adam Schreck on Twitter at www.twitter.com/adamschreck