BEIRUT — A war that began with peaceful protests against President Bashar Assad is rapidly descending into a global scramble for control over what remains of the broken country of Syria, risking a wider conflict.

Under skies crowded by the warplanes of half a dozen countries, an assortment of factions backed by rival powers are battling one another in a dizzying array of combinations. Allies on one battlefront are foes on another. The United States, Russia, Turkey and Iran have troops on the ground, and they are increasingly colliding.

In the space of a single week last week, Russia, Turkey, Iran and Israel lost aircraft to hostile fire.

The United States, meanwhile, has been battling for days to hold back Iranian-supported Syrian tribal militias in the eastern desert, drawing U.S. forces closer toward entanglement in Syria’s conflict.

“The risks are high,” said Sami Nadir, of the Levant Institute for Strategic Affairs. “There is a new Cold War prevailing in Syria and any escalation could pave the way for a regional or international war given the fact that the big powers are directly present on the ground and not through proxies, as used to be the case in the past.”

The latest confrontations come after years of fighting during which the parties to what long ago ceased to be a civil war have come to rely on outside powers for their sustenance, bringing new weapons, soldiers and also agendas flooding into Syria.

With Assad having prevailed over the rebellion against him and the Islamic State squeezed into a last sliver of territory along the Iraqi-Syrian border, the rival players now are battling to shape the final outcome of the war.

The Syrian government controls the biggest chunk of territory, with over half the country at least under nominal control of Assad loyalists, backed by Russia and Iran.

The United States holds sway over the second largest area, the 27 percent of Syria that was captured mostly from the Islamic State by Kurdish-led forces in the northeast, with the help of U.S. weapons, air power and Special Operations advisers. The United States says it will remain until there is a peace settlement, leaving open the question of how long that will be.

Turkey holds a pocket of territory in the north alongside Syrian rebels and last month launched an incursion into the adjoining Kurdish enclave of Afrin.

There, the complexity of the war is on full display. America’s NATO ally Turkey is battling U.S.-allied Kurds, who are receiving tacit support from the Syrian government.

But the government is at the same time backing the tribal militias who have been attacking the U.S.-allied Kurds and their U.S. advisers in eastern Syria.

Holding the overall balance of power is Russia, which became the dominant military power in Syria when it intervened on behalf of Assad in 2015 and now is awkwardly playing the role of both combatant and peace broker.

But it is the significantly enhanced reach of Iran that poses the biggest danger of a wider conflict.

Iran has provided the muscle in the form of manpower and money that enabled the Syrian government to reclaim most of the vast swaths of territory that fell out of government hands in the earliest years of the war, in the process expanding Iranian presence in Syria.

Israel has watched the expanding influence of Iran and its allied militias with growing alarm. Across its borders, Israel now faces Iranian commandos and allied forces, including the Lebanese Shiite Hezbollah movement and some of the most powerful Iraqi Shiite militias that challenged U.S. troops in Iraq a decade ago.

The weekend battle in which an Israeli warplane was shot down for the first time since the 1980s, struck by a hail of Syrian antiaircraft missiles provided by Russia, sharply raised the stakes for Israel and Iran. They now confront one another directly in Syria for the first time.

The clash in the skies was triggered by the entry of an Iranian drone into Israeli airspace.

Chagai Tzuriel, director-general of Israel’s Intelligence Ministry, spelled out his country’s determination to prevent Iran from maintaining its current level of influence in a postwar Syria.

“Everybody is already thinking about the day after,” he said. “The Russians and Iranians are expecting to get their fair share, having saved the regime. It just makes it more important that in this point in time we influence how Syria is shaped.”

By flying the drone into Israeli airspace, Iran had crossed a “red line,” he said.

“It was not an attack but a test of the limits and rules. For the Iranians, there is nothing better than to test the limits and get away with it, and that’s why we should not let them,” Tzuriel said.