In the front, from right to left: Jordan’s King Abdullah II, Saudi Arabia's King Salman bin Abdulaziz Al Saud, U.S. President Trump, Abu Dhabi Crown Prince Sheikh Mohammed bin Zayed al-Nahyan and Qatar’s Emir Sheikh Tamim Bin Hamad Al-Thani pose for a photo during Arab-Islamic-American Summit in Riyadh, Saudi Arabia, on May 21, 2017. (Jonathan Ernst/Reuters)

President Trump has for weeks pressed disparate forces throughout the Middle East to band together with Saudi Arabia to fight terrorism and punish Iran, long viewed by hawks inside his administration as the main source of instability and terrorism in the region.

But in his push to empower the Saudis, Trump may have unleashed problems, including increased sectarianism and regional strife, that are as bad as the one he was trying to fix, inflaming tensions that could imperil the battle against the Islamic State and other critical U.S. priorities.

“That’s the fundamental problem in the Middle East,” said Phil Gordon, a former official in the Obama White House who focused on the region. “Solving one problem in the region inevitably exacerbates others and can easily lead to escalation.”

Trump administration officials, meanwhile, attributed rising regional tensions to the failed policies of the Obama administration, which in recent years had unnerved traditional U.S. allies in the region with policies that appeared to empower Iran.

The signs of that escalation were apparent Wednesday when Iran’s leaders blamed Saudi Arabia for an attack by the Islamic State in Tehran that left 12 people dead and wounded 42 others. The stunning assault capped several days of spiraling tensions that kicked off when Saudi Arabia and the United Arab Emirates led a group of Arab allies to move against Qatar — a U.S. partner and host of the main American air base in the region — which had sought accommodation with Iran.

Trump immediately celebrated the Saudis’ move and even took some credit for it on Twitter.

“During my recent trip to the Middle East I stated that there can no longer be funding of Radical Ideology,” Trump said on Tuesday. “Leaders pointed to Qatar - look!”

The danger for the United States and the Trump administration is that the spiraling tensions and saber-rattling throughout the region could imperil some of its key initiatives.

Sunni-led monarchies Saudi Arabia and Qatar are both part of the U.S.-led coalition against the Islamic State, a Sunni extremist movement that both have been accused over the years of at least indirectly financing.

Qatar is also part of a fragile, Saudi-led coalition fighting against Houthi rebels, in Yemen, backed by Iran’s Shiite government.

Defense Secretary Jim Mattis has made rolling back Iran’s ambitions in Yemen and reaching a negotiated settlement with the rebels a top priority as a step toward containing it across the region. A split among the Arab partners fighting there would be a significant boon for Iran, said analysts.

Yet Trump appeared to take Saudi Arabia’s side this week in a dispute with Qatar that his own senior national security advisers tried to quell with evenhandedness.

Qatar is an “artificial crisis,” said Michele Dunne, a Middle East expert at the State Department from 1986 to 2003 and director of the Middle East program at the Carnegie Endowment for International Peace.

“All of the issues being cited — support for Hamas and the Muslim Brotherhood” and the Qatar-based media organization Al Jazeera, which has been critical of both the Saudis and the U.A.E. — “have been going on for years now,” Dunne said. “Why, all of a sudden, is there a crisis over it now? It does seem as though the Trump administration’s approach to the region has sent a message to Saudi Arabia and the Emirates that they can call the shots in the region, and the U.S. will stick with them.”

Dunne and Christopher Davidson, associate professor in Middle East politics at Durham University in England, suggested that Saudi Arabia’s long-range plan, in addition to forcing Qatar to mitigate its more open attitude toward both Iran and political Islam, may include inviting the United States to move its air operations in the region from Al Udeid Air Base in Qatar back to Saudi Arabia.

So far, Davidson said: “Qatar is sticking to its guns. Turkey has pledged to support them, and there is provocative news that Iran might support them, too.”

Senior Trump administration officials criticized the idea that Trump’s backing for the Saudis on his recent trip or his latest tweets condemning Qatar for terrorism financing had contributed to instability or sectarian tension in the region. Instead, one White House official said that it was the previous administration’s chilly relationship with Saudi Arabia and its deal with Iran to halt its nuclear weapons program that had “unleashed sectarianism.”

From the opening moments of his trip to the Middle East, Trump made clear that he was determined to take the opposite approach of his predecessor. President Barack Obama assiduously avoided taking sides in the region’s sectarian conflicts and infuriated the Saudis by suggesting that they would have to “share” the region with Iran.

“The Saudis interpreted that as the president telling them that the Iranians are a predator, and they should acquiesce to their ambitions and surrender to them,” said Dennis A. Ross, who served as a senior Middle East adviser to Republican and Democratic presidents. “That is not my interpretation. That is literally what I was told in the region.”

Since taking office, Trump has flipped the script, prioritizing the battle against all forms of terrorism over sectarian and regional tensions. The result for now is a stepped-up battle against the Islamic State that has led to deeper U.S. military involvement, some impressive battlefield gains and greater civilian casualties.

Both Trump and the Saudis described the president’s meetings in the kingdom last month as the beginning of a new era in U.S.-Arab relations, the fight against terrorism and a much harder line on Iran.

“People have said there has really never been anything even close in history,” Trump said.

His national security adviser, H.R. McMaster, amplified that message and spoke hopefully of a new alliance involving Israel and America’s Arab partners — “all friends of America but too often adversaries of each other” — to roll back Iranian influence.

In a meeting with reporters, McMaster described Iran as “the greatest state sponsor of terrorism in the world” and a malign influence that has perpetuated civil wars throughout the region.

“These are really, really good reasons to focus on a concerted effort to counter Iran’s destructive activities,” McMaster said.

The long-term bet is that the United States’ allies will be willing to take a harder line against Sunni Arab terrorist groups, such as the Islamic State, if the United States is also taking a harder line against Iran, which the Saudis and the Emiratis see as an existential threat.

In recent days, though, it has been hard to divine the exact policy that the administration is pursuing, especially regarding the dispute between the Qataris and the powerful Saudi-led bloc opposing them, and whether it is promoting more or less stability.

“What they are doing vis-a-vis Qatar is really unprecedented,” Ross said. “ This is not symbolic. You break diplomatic relations, deny Qatari planes the ability to operate in your airspace, call back nationals. This is a very tough response.

“The policy looks very much like a work in progress,” Ross said.