Even as internationally backed forces chip away at Islamic State-held territory in Syria, Iraq and Libya, the militants have demonstrated a stubborn resilience this week in the face of recent losses.

The ISIS forces dealt an embarrassing setback to the Syrian army near the militants' self-styled capital of Raqqa with a swift counter-offensive that rolled back incremental gains by troops loyal to President Bashar Assad.

Pockets of extremist fighters north and west of Fallujah continued to hold off elite Iraqi special forces Wednesday, preventing them from making significant advances one month after the government launched its campaign to retake the city west of Baghdad.

And in the battle for the Libyan city of Sirte, pro-government forces besieging the ISIS stronghold were stunned by renewed clashes there, with 36 people killed, a hospital spokesman said.

Just two weeks ago, the Islamic State had suffered setbacks in all three countries in the region, where it had previously captured large tracts of territory.

Seesaw battles raged in Syria's Raqqa province, with ISIS fighters retaking areas from government forces Tuesday. Two days earlier, the Syrian troops briefly seized an ISIS-held oilfield in Thawra and threatened to retake the Tabqa air base, which would have opened a direct line for troops to the city of Raqqa. The government began its highly publicized campaign to retake Raqqa on June 2.

On Sunday, the troops advanced to within 10 kilometers of the Tabqa base, which is about 45 kilometers from Raqqa and holds strategic and symbolic value for the government. It was the last position held by government forces in Raqqa province before the militants overran it in August 2014, killing scores of detained Syrian soldiers in a massacre documented on ISIS video.

The commander of an elite, pro-government militia known as the Desert Hawks explained the government's rapid withdrawal from large parts of Raqqa province. "It is vital to understand that [ISIS] adopted new tactics to fight the Desert Hawks in this area," said retired Gen. Mohamad Jaber.

Writing on his Facebook page Tuesday, he said the militants were sending explosives-packed vehicles at the pro-government line, and he predicted the battle for Tabqa would be "harsh and mighty."

Activists gave conflicting casualty counts for civilians killed in airstrikes on the city of Raqqa, with death tolls ranging from 18 to 32. Differing casualty figures are common in reporting from Syria's civil war, now in its sixth year.

The activists said the Syrian air force, backed by warplanes from its ally, Russia, had pummeled the Islamic State extremists after government losses earlier this week.

The U.S.-led coalition also has been bombing Raqqa. Col. Christopher Garver, the Baghdad-based spokesman for the coalition, told The Associated Press that four airstrikes were carried out Tuesday near Raqqa. They targeted an ISIS tactical unit, a finance center, a headquarters and an oil facility, Garver said. He had no reports on casualties.

The activist group known as Raqqa Is Being Slaughtered Silently said at least one of the airstrikes targeted a neighborhood popular among "foreign fighters" — militants who have traveled to Syria to fight with ISIS.

In northern Syria, U.S.-backed Syrian Kurdish forces encircled ISIS militants in the town of Manbij, a vital position that connects the Turkish border to Raqqa.

As the Iraqi military offensive to retake Fallujah entered its second month Wednesday, clashes continued to try to dislodge ISIS militants from besieged neighborhoods.

Iraqi special forces pushed into the center of the city last week and retook a government compound and the central hospital. Officials said they are still working to secure the territory.

At the central hospital, Corp. Ahmad Ahmad warned that only parts of the first floor were fully cleared of homemade bombs because teams specializing in defusing the explosives are in short supply and have been mostly deployed to help troops on the front lines.

Ahmad said his forces had not preformed house-to-house searches in surrounding buildings, including the Khalifa Mosque along Fallujah's main highway.

"Right now, we are focusing on clearing the roads," he said, adding that the painstaking process of searching buildings would require more troops and risk greater casualties.

Prime Minister Haider al-Abadi said Friday that Fallujah had "returned to the embrace of the nation," and that remaining ISIS pockets would be "cleaned out within hours." Clashes have persisted, however, with militants holed up in dense residential neighborhoods along the city's northern edge.

On Tuesday, the U.S.-led coalition said only a third of Fallujah has been "cleared," and other parts remain contested. Iraqi commanders say 80 percent of the city is under their control.

Fallujah is one of the last ISIS strongholds in Iraq. At the height of its power, the group held nearly a third of the country, but a string of territorial losses has left only pockets of territory in Iraq's north and west under ISIS control.

The second- largest city of Mosul is the group's last remaining urban holdout.

In Libya's coastal city of Sirte, fierce fighting with ISIS militants killed 36 militiamen aligned with the UN-brokered government. The militias, mainly from the western town of Misrata, have been battling since May to try to take full control of Sirte, the last bastion of the Islamic State group in the North African country.

After a rapid advance into the city, the militias were slowed by a series of ISIS suicide bombings. Along with the 36 militiamen killed, mostly in direct gun battles, about 140 were wounded, said Misrata hospital spokesman Abdel-Aziz Essa.

ISIS fighters reportedly have hunkered down at their headquarters in the sprawling Ouagadougou convention center built by the late dictator Muammar Gadhafi. Sirte was Gadhafi's birthplace and the place where he fled during the 2011 civil war, when Libyan rebels backed by NATO warplanes forced him out of the capital of Tripoli.