The recent fall of the northern Syrian city of Raqqa is one more indicator that the days of the Islamic State’s caliphate in Syria are numbered.

Raqqa, its self-proclaimed capital since 2014, was captured by U.S.-backed Arab and Kurdish forces on October 17 after four months of intense battles, which reduced much of it to rubble and displaced the vast majority of its population.

Raqqa fell two months after the Iraqi army, backed by U.S.air power, drove Islamic State out of Mosul, the second largest city in Iraq.

Clearly, these are not the best of times for Islamic State, which has lost about 90 percent of its land holdings in Iraq and Syria in the past two years.

Coming in the wake of a series of demoralizing defeats in Syria and Iraq, the loss of Raqqa was a particularly bitter pill for Islamic State’s leaders to swallow. But analysts do not believe it is completely finished. Approximately 6,500 of its fighters are still entrenched in eastern Syria and western Iraq, many concentrated in the Euphrates River Valley around the Syrian-Iraqi border.

Despite having lost so much territory, Islamic State has begun to reinvent itself as an insurgent group, still posing a threat to Syria and Iraq, as well as to neighboring Arab countries and nations outside the Middle East. In short, Islamic State is still very much capable of launching massive suicide attacks on soft targets such as cafes, restaurants, markets, schools and airports.

In Syria, a country wracked by a civil war since 2011, two opposing coalitions are converging on Islamic State strongholds in the eastern province of Deir al-Zour, the site of Syria’s oil fields. On one side are the United States and the Syrian Democratic Forces, composed of Syrian Kurds and Arabs. On the other side are Syria and its allies, Russia, Iran, Hezbollah and Shiite militias aligned with Iran.

Syria’s overarching goal is to reclaim lost territory. Its allies are motivated by an array of  interests.

Iran regards the current turmoil as a golden opportunity to expand its influence in the region and to establish a contiguous land corridor from Iran, through Iraq and Syria, to Israel’s border on the Golan Heights. This is a scenario that alarms Israel.

Hezbollah, having been armed by Syria, is repaying a debt of gratitude to the ruling Assad family.

Russia is propping up a Syrian regime that has been allied with Moscow for decades. In 2015, Russian President Vladimir Putin dispatched dozens of aircraft and thousands of military personnel to Syria in a bid to save President Bashar al-Assad’s regime from defeat.

Since the Russian intervention, Assad has consolidated his grip on much of western Syria, having regained control of major cities like Aleppo and Homs, and has seized the momentum on the battlefield. Assad’s strategy now is to extend his control to eastern Syria.

“Assad’s government has won the war militarily,” the former U.S. ambassador to Syria, Robert Ford, said recently. “And I can’t see any prospect of the Syrian opposition being able to compel him to make dramatic concessions in a peace negotiation.”

Israeli Defence Minister Avigdor Liberman agrees with Ford. “Assad has emerged victorious in the battle,” he said two weeks ago.

When the civil war in Syria erupted, the policy of the United States was to unseat Assad. In pursuit of this objective, the U.S. Central Intelligence Agency supplied arms to hand-picked Syrian rebels opposed to Assad. Last June, the Trump administration disbanded this program on the grounds that it had been ineffective. .

Today, the United States is focused on destroying Islamic State in Syria. Since 2014, U.S. aircraft have been bombing its bases and convoys.

Nevertheless, Assad’s regime remains an adversary of the United States. Last April, U.S. President Donald Trump ordered a cruise missile attack on an air force base in Syria after Syrian jets dropped bombs laced with the nerve agent sarin on a rebel-hold town in northern Syria, killing and wounding scores of civilians. In the wake of the U.S. bombardment, U.S. forces in Syria shot down a Syrian aircraft as well as two Iranian drones.

Given all these flashpoint, the military and geopolitical landscape in Syria has become extremely complicated, but for the United States, the destruction of Islamic State is still its chief priority, as the protracted battle for Raqqa indicated.