A U.S. air campaign against Islamic State militants in Libya, which was supposed to be a brisk illustration of the effectiveness of U.S. support for local forces, has turned into an extended operation with no clear end in sight.

About 100 militants are believed to remain in the coastal city of Sirte, which in 2015 became the most important Islamic State stronghold outside of Iraq and Syria. They are holed up in a small, densely packed residential area. For months, U.S.-backed local militia fighters have struggled against militant defenses and sniper attacks; last week, 14 fighters were killed on one day alone.

The elusiveness of victory in Sirte underscores the challenges that continue to face U.S. efforts to defeat extremists from North Africa to Afghanistan: the limitations of local fighting forces, including inadequate battlefield support and poor morale, and the corrosive effects of local political feuds.

The same elements are certain to test the U.S.-backed effort to recapture Mosul, the large Iraqi city where a multipronged operation is now unfolding against the Islamic State.

“It matters for the United States and other Western countries that an operation that was initially thought to last weeks could last months, and it’s unclear what happens after ISIS disappears from Sirte,” said Mattia Toaldo, a senior policy fellow at the European Council on Foreign Relations. ISIS is one of the acronyms for the Islamic State.

The operation in Sirte, a small city that was largely depopulated after the Islamic State’s arrival, was supposed to be relatively simple to execute. While the group’s Libya branch had shown itself to be just as brutal as its parent, its members were far fewer in number. They lacked the same local support they found in Iraq and Syria, and operated with fewer revenue sources.

But militia forces from the nearby city of Misurata quickly became bogged down after they launched their operation to retake Sirte in May. When the U.S. strikes began at the request of the U.S.-backed Libyan unity government on Aug. 1, military officials hoped the operation would conclude in a matter of weeks. Since then, U.S. aircraft have conducted about 330 strikes on militant targets in Sirte. The operation has been extended twice.

It has been harder than expected “getting this last little bit,” a U.S. defense official said, speaking on the condition of anonymity to discuss operations by partner forces. “Because of the casualties the Misuratans have taken, they want to be judicious and precise . . . without leveling entire buildings,” he said. “When you work by, with and through, you accept the timeline of the forces you’re fighting with.”

While local military leaders say the operation will be over soon, they must confront extensive militant defenses including tunnels and booby-traps. As they are likely to do in Mosul, fighters in Sirte have also relied heavily on snipers who have slowed the advance of local forces.

While the Misuratans have taken pauses in recent months to regroup, U.S. officials say they have made slow, incremental progress when they have been active. Sometimes that has been as little as a tenth of a kilometer a day.

Col. Mark Cheadle, a spokesman for U.S. Africa Command, said the United States would continue to provide air support designed to limit civilian casualties and unnecessary damage. “We’re confident that Daesh will lose Sirte, just as it will lose its territory in Libya, Iraq, in Syria,” he said, using the Arabic acronym for the Islamic State.

The militants appear to have adapted to U.S. strikes, showing themselves infrequently. U.S. officials believe some women and children, presumably fighters’ families, may be among those remaining, making U.S. officials reluctant to flatten apartment buildings. They also believe that militants, trapped between local forces and the Mediterranean, have decided there is little reason not to fight to the death.

Just as important is the exhaustion felt by Misuratan forces, which have taken heavy casualties and have struggled to secure stipends and supplies. Hospitals in Misurata have also lacked adequate beds and medical care, making commanders reluctant to push troops into close combat.

An Italian medical mission being launched this week is aimed to ease the lack of care for the wounded.

The ground effort is assisted by a small number of U.S. Special Operations forces that set up a base on the outskirts of the city.

The pro-government advance has also been strained by the political crisis that continues to consume Libya. Almost a year after a landmark political deal was reached, a Western-backed unity government has not been validated by lawmakers. It now faces increasing challenges from rival factions and growing criticism from Libyans desperate for services and security.

It also is unclear who will govern Sirte after militants have been defeated, potentially complicating the battle’s concluding phase.

In a sign of mounting frustration with the overall pace, leaders of the pro-government force have also complained about the effectiveness of U.S. strikes.

Since the departure of the USS Wasp, an amphibious assault ship from which Marine AV-8B Harrier jets had been conducting strikes in Sirte, drone strikes have accounted for virtually all air attacks on Sirte.

The USS San Antonio, an amphibious transport dock ship, is standing by in the event that U.S. Special Operations personnel around Sirte require assistance.

“There is a lot more resistance, and more effective, than expected,” Toaldo said.

Read more: