The Islamic State is struggling to mount an effective defense of the Syrian city of Raqqa, its headquarters, as local forces make rapid headway in ousting the militants, the U.S. military said.

The U.S.-backed Syrian Democratic Forces (SDF) said they have captured 40% of the city since June 6, when a ground assault began.

“We don’t see any significant counterattacks,” said Air Force Maj. Gen. Dirk Smith, a deputy commander of the U.S.-led coalition, “I’d characterize them in disarray.”

Since this month's recapture of Mosul, Iraq’s second-largest city, from the Islamic State, Raqqa has become the main focus of the fight against the militants, also known as ISIS. The battle to win back control of Mosul took nearly nine months.

It’s not clear how many ISIS fighters remain in Raqqa. Before the offensive began, some leaders escaped to the city of Mayadin, southeast of Raqqa on the Euphrates River. “ISIS made a strategic retreat,” said Andrew Tabler, an analyst at the Washington Institute for Near East Policy.

Smith said U.S. airstrikes and surveillance support have helped weaken the militants in Raqqa, leaving them confused and unable to effectively defend the city.

“ISIS is not quite sure what to do,” he said, adding that the militants have not been able to leave or enter the city.

SDF fighters and U.S. strikes began operations to isolate the city and weaken defenses months before the final ground offensive was launched.

One advantage the SDF has over Iraq’s military while fighting in Mosul is the terrain. Many neighborhoods in Mosul are crowded with narrow streets and alleys, and the city was home to about 150,000 civilians as Iraqi forces began their final assault. Attacking in a city is among the most difficult types of combat.

Raqqa is smaller than Mosul and not as densely packed.

But the U.S.-backed forces in the Raqqa offensive are not as well organized as Iraq's military, which led the ground assault into Mosul. In Syria, the coalition relies on a loose coalition of Arab and Kurdish fighters who don’t have the same level of training and organization as Iraq’i troops.

The United States provides the SDF's 50,000 fighters with arms and has deployed hundreds of advisers to work with them.

The coalition has increased airstrikes as the SDF closes in on Raqqa. On Tuesday, the coalition launched 24 strikes around the city, destroying 14 militant units, six fighting positions, four observation posts and other targets, U.S. Central Command reported.

It is difficult to predict whether the SDF will be able to maintain the pace of recent weeks. The militants may be allowing the opposition to advance into the city before hitting them with counterattacks, a tactic used in Mosul, said Jennifer Cafarella, an analyst at the Institute for the Study of War in Washington, D.C.

The Mosul offensive slowed amid stiff resistance from ISIS after an initial rapid advance.

The eventual fall of Raqqa will bring the coalition closer to ending ISIS control over cities and towns in Iraq and Syria, but it will not end the group’s ability to launch terrorist attacks in Europe and elsewhere and spread propaganda over the Internet.

“The physical representation of the caliphate will fall, but they have had three years to prepare for that,” said Katherine Zimmerman, an analyst at the American Enterprise Institute.

“These guys never give up,” Cafarella said.

Read more:

Offensive to drive ISIS from Raqqa 'capital' in Syria begins

Iraqi forces have fully retaken Mosul, U.S.-backed coalition confirms

Fight against ISIS 'far from over' despite terrorist group's loss of Mosul