BEIRUT – U.S.-backed forces in Syria claimed Tuesday they had full control of the Islamic State’s onetime capital of Raqqa, suggesting an end to the militants’ presence in their most symbolically important stronghold.

Talo Silo, a spokesman for the Syrian Democratic Forces, or SDF, said that military operations had halted and that members of the joint Kurdish-Arab force were clearing the city of explosive devices and hunting for sleeping cells.

It was still unclear whether some Islamic State pockets remained, but the SDF portrayed the battle for Raqqa as over. Kurdish and Arab fighters jubilantly took to the streets to celebrate the capture they have spent four months fighting for, climbing onto vehicles and parading around the deserted, destroyed city, according to photographs posted on social media. One showed the offensive’s female commander, Rojda Felat, waving the big yellow and red flag of the SDF in Naim Square, where the Islamic State carried out beheadings.

By the time the battle was over, Raqqa had lost all strategic significance to the group that had once used the city to showcase its brutality and plot attacks against the West. The fall of the Iraqi city of Mosul in July and the loss of large areas of territory in eastern Syria to Syrian government forces leave the militants in control of just a few pockets of territory spanning the Iraqi-Syrian border.

But the capture of the city by the SDF, backed by U.S. airstrikes and U.S. advisers on the ground, nonetheless marks a milestone in the U.S.-led effort to defeat the militants.

It also intensifies growing questions about what comes next. The remaining Islamic State strongholds in Syria lie to the south in the province of Deir al-Zour, where the Syrian government and its Iranian-backed and Russian allies are already making fast progress. It is unclear whether the U.S. military has plans to compete with them there to take on the Islamic State, or whether the Kurdish-led SDF will be willing to extend its reach that far.

Perhaps more importantly, the Trump administration has not yet indicated whether it is prepared to stay on in northeastern Syria to provide protection for the fledgling ministate being forged by Syria’s Kurds. The experience over the past two days of the Kurds in neighboring Iraq may embolden the Syrian government to challenge the Syrian Kurdish enclave once the Islamic State is vanquished, just as the Iraqi government has moved to dislodge Kurdish forces from the oil-rich city of Kirkuk and other areas they controlled.

The offensive to capture the city began in June, with the SDF advancing on the ground as U.S.-led coalition airstrikes pummeled the militants down below. As was the case in Mosul, victory over the militants has come at a tremendous price. Much of the city now lies in ruins, its residents scattered throughout displacement camps across the country. At least 1,000 civilians are said to have died, according to estimates by monitoring groups, most of them in the relentless airstrikes.

Besieged and severely weakened, dozens of militants had launched a final stand from inside Raqqa’s main hospital and stadium. But hundreds of others surrendered during the final days of the battle after local officials brokered a controversial deal that could see many escape prosecution.

Raqqa was the first provincial capital to fully fall from government control when it was captured by a rebel army containing moderate and hard-line groups, including the al-Qaida-linked Jabhat al-Nusra, in March 2013.

It established a civilian government but divided into factions two months later, with one renaming itself the Islamic State of Iraq and al-Sham, or ISIS. After the city’s Islamist militants swore loyalty to the group, it became their de facto capital, and by January of 2014, the extremists were firmly in control.

Syrian forces liberated the city of Raqqa from Islamic State militants, a senior commander said, in a major defeat for the collapsing extremist group that had proclaimed it to be the capital of its “caliphate.”

If Mosul gained notoriety as pulpit from which the Islamic State declared its religiously inspired caliphate, Raqqa became the stage from which it showcased its form of rule. Residents were corralled to watch executions and other acts of ritual humiliation in its central square.

Raqqa’s southern mountains provided the backdrop to perhaps the group’s most infamous execution of all — that of American journalist James Foley, dressed in an orange jumpsuit and forced to castigate President Barack Obama’s foreign policy before he was beheaded by a British militant, Mohammed al-Emwazi.

Known first to the world as “Jihadi John,” the Kuwaiti-born fighter would go on to kill several more Western hostages before he died in a U.S. drone strike on the city’s central square.

Three years after Raqqa’s capture, the Islamic State’s fortunes have changed drastically. Its once sweeping caliphate has been reduced to a patch of territory in Syria’s Deir al-Zour and the Iraqi province of Anbar, and some small scattered areas elsewhere. Returning to its roots, it has become a guerrilla force with few hopes of reversing its decline in the near future.

Yet analysts and diplomats say they fear it will come back in a different guise. The fight to dislodge the Islamic State has also intensified the very problems that led to its rise in the first place.

In both Iraq and Syria, Sunni Muslims have been on the losing end of the civil wars that engulfed the countries — fueling support for these extremist groups.

In Syria especially, the forces driving out the Islamic State have few ties to the local population, leaving the way open to yet another cycle of disputes over land, resources and power.

Success or failure will hinge on how Raqqa’s new rulers now govern. A U.S.-backed civilian council is waiting in the wings, already furnished with plans to repair shattered infrastructure.

Restoration of security will be among its greatest challenges. Other newly recaptured areas have suffered devastating Islamic State counterattacks, killing scores.

Washington Post writers Zakaria Zakaria, Erin Cunningham and Heba Habib in Stockholm contributed to this report.