On Sunday evening, a U.S. warplane shot down a Syrian jet after it bombed American-backed rebels in northern Syria. This marked the first time the United States has downed a Syrian warplane since the start of the country’s civil war in 2011. On Tuesday, the Pentagon announced that the United States had shot down an Iranian-made drone in the country’s southeast, where American personnel have been training anti-Islamic State fighters.

Since President Donald Trump took office, the U.S. military has struck the Syrian regime or its allies at least five times, in most cases to protect U.S.-backed rebels and their American advisers. Even if the Pentagon may not want to directly engage Syrian forces or their Russian and Iranian-backed allies, there’s a danger of accidental escalation, especially as various forces continue to converge on eastern and southern Syria to reclaim strategic territory from ISIS. Russia, for its part, angrily condemned the U.S. action and threatened on Monday to treat all coalition planes in Syria as potential targets.

But the dangers are perhaps particularly acute when it comes to Iran, which made dramatic battlefield moves of its own on Sunday, when it launched several missiles from inside Iran against ISIS targets in eastern Syria. Officially, Iran’s Revolutionary Guards said the volley of missiles fired at Deir Ezzor province was a response to a pair of attacks by ISIS in Tehran on June 7, which killed 18 people and wounded dozens; the attacks marked the first time that ISIS had struck inside Iran. But the Iranian regime had several less-dramatic means to exact revenge against ISIS targets in Syria—after all, there’s no shortage of Iranian allies operating in the war-ravaged country.

Instead, Iran’s fiery act of vengeance seemed to be a message aimed at both the Trump administration and Saudi Arabia. (The six ballistic missiles used by Tehran against ISIS, with a range of 700 kilometers, could reach major Saudi cities.) The kingdom has become emboldened regionally and escalated its anti-Iran rhetoric thanks, in part, to Trump’s message of seemingly unconditional support.

At the same time, Trump’s apparent willingness to use military force against Syrian President Bashar al-Assad and his chief supporters risks sparking a widening confrontation, while distracting from what he insists is his top priority: defeating ISIS in Iraq and Syria. This, from a president who campaigned, in part, on a pledge to avoid direct U.S. involvement in the Syrian conflict. Now, Trump has become a major player in an exploding regional proxy war that could determine the Middle East’s post-war dynamics.

Sunday’s events place the danger of escalation and the staggering complexities of the phalanx of alliances in Syria into stark relief. The confrontation began when U.S.-allied fighters with the Syrian Democratic Forces (SDF), a coalition of Kurdish, Sunni Arab, Christian, and Turkmen rebel groups anchored by the largely Kurdish People’s Protection Units (YPG), came under attack from “pro-Syrian regime forces” in a town south of Tabqa, the site of a strategic dam that had been under ISIS control for several years until the SDF captured it in May. (Over the past year, the SDF and YPG had largely avoided confrontation with Syrian forces—a modus operandi that may be changing as Assad and his allies grow bolder in the race for control of southeastern Syria.) The Pentagon coordinates its activities in Syria with Russian forces, and U.S. officials said they contacted their counterparts on a “de-confliction” phone line asking them to intervene with Syrian forces to stop the attacks. But two hours later, the Pentagon said, a Syrian-regime jet dropped bombs near SDF fighters, and it was shot down by a U.S. Navy plane.

Afterwards, the Pentagon said it would protect the Syrian rebels it has been training and arming for more than year to launch the assault on ISIS in Raqqa. “The coalition’s mission is to defeat ISIS in Iraq and Syria,” the U.S. statement said. “The coalition does not seek to fight [the] Syrian regime, Russian, or pro-regime forces partnered with them, but will not hesitate to defend coalition or partner forces from any threat.”

And foremost among those threats, in the eyes of the Trump administration, is Iran. While Trump has changed his mind on a number of foreign-policy questions since taking office, he has been consistent in his belief that Iran, the world’s main state sponsor of terrorism, poses the greatest threat to U.S. interests in the Middle East. He’s surrounded himself with advisers like Defense Secretary James Mattis and National Security Adviser H.R. McMaster, battle-hardened former military commanders who want to take an aggressive approach to contain Iran.

Nowhere is Iran projecting its regional power more extensively than Syria. Since the war started, Tehran has sent billions of dollars in aid and thousands of troops and Shiite volunteers to support Assad’s men. Over the past two years, Russia and Iran, along with Hezbollah and several Iraqi Shiite militias, helped Assad consolidate control and regain territory he lost to Syrian rebels and foreign jihadists. In December, with intensive Russian airstrikes and Iranian ground support, Assad’s forces recaptured the rebel-held sections of Aleppo, Syria’s largest city. It was Assad’s biggest victory since the war began.

The next prize for the Syrian government and its allies is the eastern province of Deir Ezzor, home to the country’s modest oil fields. Most of this region was lost to the Assad regime by late 2013, although the Syrian military remains in control of parts of Deir Ezzor city, where about 200,000 people are besieged by ISIS. This desert expanse includes several border crossings between Syria, Iraq, and Jordan—and the strategic highway connecting Damascus and Baghdad. In recent weeks, Syrian troops, along with Hezbollah and other Shiite militias, have been moving to consolidate control over the area and to connect with Iranian-backed militias who are fighting to dislodge ISIS from the Iraqi side of the border.

What worries the Trump administration: that with these gains, Iran and its allies will carve out a “Shiite crescent” extending from Iran, through Iraq and Syria, and into Lebanon, where Hezbollah is the most powerful political and military force. Such a prospect looms large not only for the Trump administration, but also its allies in the Arab world, especially the Saudis.

Since taking office, Trump and his top advisers have shifted their rhetoric to reflect more explicit support for Saudi Arabia and its Sunni Arab allies, and, in turn, a harsher view of Iran. The shift was cemented during Trump’s much-hyped visit last month to the kingdom, which he chose as the first stop on his maiden overseas trip as president. Like his Saudi hosts, Trump framed the problems of the Middle East as due solely to Iran’s belligerence and terrorism by Islamic extremist groups, despite the kingdom’s destabilizing activities across the Middle East, including its ongoing catastrophic war in Yemen and blockade of Qatar.

Meanwhile, Iranian officials are growing increasingly frustrated at the Trump administration’s constant attacks on the July 2015 agreement Tehran signed with the United States and five other world powers to limit its nuclear program in exchange for the lifting of international sanctions. Perhaps still smarting from Trump’s speech in Saudi Arabia, in which he castigated Iran for stoking “the fires of sectarian conflict and terror,” Iran’s supreme leader, Ayatollah Ali Khamenei, also stepped up his anti-Trump rhetoric on Sunday, calling him “an inexperienced thug.”

In truth, the United States has already been making risky bets and forging fragile alliances that threaten only to heighten the complex conflicts underlying Syria’s war. Under the Obama administration, U.S. policy in Syria was focused on containing ISIS, largely ignoring Assad, and keeping America’s allies from fighting each other. Today, Trump is abandoning that ambiguity, whether by trying to blunt the ambitions of Iran and the Assad regime in southern Syria, or by backing a Pentagon plan to arm the Syrian Kurds over the objections of Turkey. In May, his administration approved the Pentagon’s plan to provide heavy weapons to the SDF-led rebels fighting to expel ISIS from Raqqa, capital of its self-proclaimed caliphate. The decision pitted two main U.S. allies in the Syrian war, Turkey and the Syrian Kurds, against each other.

While the Pentagon is eager to portray its latest actions as a defensive measure, Assad’s regime and its Iranian allies view it as an aggression, noting that Washington shot down a Syrian jet in Syrian airspace. And by flexing their military reach in Syria with Sunday’s missile launch, Iran’s Revolutionary Guards and other regime hardliners risk inflaming more tension with the Trump administration—tension that could boil over in the coming war for dominance of southern Syria. One danger, among many, is that Assad and Tehran, which both have a history of testing their adversaries’ boundaries, could overreach and provoke a confrontation that spirals out of control.