(CNN) It's been a tough month for the "Islamic State." Its fighters were finally driven out of the Syrian border town of Kobani after more than 100 days of fighting against Kurdish militia; Iraqi government forces pushed ISIS back in Diyala province; the city of Mosul -- still under ISIS control -- is beginning to look vulnerable. And airstrikes have taken a toll on the group's infrastructure and field commanders.

Its ability to win the release of a jailed jihadist in Jordan or the ability of its followers in Libya to attack a Tripoli hotel may provide brief propaganda boons, but they don't affect the fundamentals on the ground. Nor will its attempts to export terror to Europe.

But lest anyone declare victory, predictions of ISIS' demise are wildly optimistic. ISIS still controls some 50,000 square kilometers of Iraq as well as up to 30% of Syrian territory and at least 10% of its population. To the west of Baghdad, it is still on the offensive in Anbar, and recently raided checkpoints on the Iraqi-Saudi border. Pentagon spokesman Rear Admiral John Kirby said last week: "We're only six to seven months into this thing....This is going to be a long struggle."

A senior official at the U.S. State Department echoed Kirby's line this week, saying ISIS' expulsion from Kobani is part of the "early phase of a multi-year campaign." ISIS is "a very adaptive organization," the official said -- and terms like "turning point" were to be avoided.

Even so, there's quite a contrast between September, when U.S. officials said the fall of Kobani to ISIS seemed inevitable, and Kurds celebrating on the city's streets this week. ISIS chose Kobani as a symbol of its virility, even sending hostage John Cantile there to make a video about the group's inevitable victory. Kobani was a recruitment poster in ISIS' efforts to draw more foreign fighters to the Caliphate.

JUST WATCHED ISIS loses battle for Kobani Replay More Videos ... MUST WATCH ISIS loses battle for Kobani 02:03

ISIS continued to reinforce its presence in the town despite constant airstrikes. General John Allen, U.S. coordinator of the campaign against ISIS, said in November that the group had "impaled itself" on Kobani. The State Department official said ISIS' losses there -- likely running into four figures -- could help counter the messaging that has attracted foreign fighters.

"A narrative of inevitable glory and conquest" had been replaced by images of bodies left on the streets, the official said.

A growing number of those foreign fighters may also be disillusioned after several months of airstrikes. Setbacks in Kobani and elsewhere have led to a stream of deserters, dozens of whom have been executed according to local activists cited by the Syrian Observatory on Human Rights. Analysts say one trend in coming months may be a stream of disillusioned foreigners trying to escape ISIS territory.

In Iraq a leading expert on ISIS, Hisham Al Hashimi, told CNN that ISIS has now lost ground in several areas and needs to regroup. Torbjorn Soltvedt, a senior analyst at consultancy Verisk Maplecroft, agrees that ISIS is on the back foot in Iraq, relying more on classic insurgency tactics such as roadside bombs and unable to move in force because of the threat of airstrikes.

Among its latest reverses, ISIS has lost control over a number of villages in the province of Diyala, north-east of Baghdad. Iraqi troops and Shia militia known as Popular Mobilization Units launched an offensive last week to retake ISIS' last strongholds around Muqdadiyah -- 50 miles (80km) from the capital. According to Iraqi commanders, the whole province of Diyala is now back in government hands, after several months of intermittent battles. Soltvedt says it became increasingly difficult for ISIS to sustain its supply lines in the region.

JUST WATCHED U.S. has to stop ISIS' 'narrative of success' Replay More Videos ... MUST WATCH U.S. has to stop ISIS' 'narrative of success' 04:58

The key prize for all sides in Iraq remains Mosul, a city of 1.5 million people on the Tigris river, held by ISIS since last June. ISIS has invested heavily in governing the city; its leader Abu Bakr al Baghdadi pronounced his leadership of the Caliphate at the Grand Mosque there last July. For their part, Kurdish officials say that as long as ISIS holds Mosul, it threatens Kurdistan. Likewise, neither the government in Baghdad nor its coalition partners can rest while terrorists occupy Iraq's second-largest city.

Peshmerga forces have made steady progress against ISIS north and west of Mosul over the last two months. They have taken some 3,000 square kilometers of the Sinjar area, as well as the area around the Mosul dam, choking off access routes and threatening ISIS' main resupply route to Syria. To the south, Iraqi forces' gains around Baiji have also restricted ISIS' freedom of movement.

The Institute for the Study of War (ISW), which studies military activity in Iraq and Syria, says ISIS is preparing to dig a defensive trench around Mosul, and has blown up a bridge on a key western approach.

ISW also reports an increase in executions by ISIS across Nineveh province, where Mosul is located, which it sees as further evidence "ISIS is feeling pressured by internal resistance in the province." (There is anecdotal evidence of resistance across the border in Syria too; a senior ISIS police official who had supervised executions was himself found beheaded in Deir Ezzor early in January.)

There had been talk of a January offensive to retake Mosul, but any assault now seems many weeks away. Kirby told CNN's Barbara Starr Tuesday that the timing could not be predicted "but obviously we're working closely with Iraqi security forces on helping them better understand the challenges" of an assault on Mosul.

JUST WATCHED U.S. officials: We're retaking Mosul next Replay More Videos ... MUST WATCH U.S. officials: We're retaking Mosul next 02:05

Iraqi units are already fully occupied elsewhere -- notably in Anbar province, where ISIS threatens Ramadi and other areas. An assault on Mosul would have to be meticulously co-ordinated from several different directions, informed by good intelligence and supported from the air. A massive intelligence-gathering effort is already under way, according to analysts.

Even so, Mosul's remaining residents are predominantly Sunni Arabs and would be wary of Kurdish and Shia militia, so regular forces from the reconstituted Iraqi army would likely have to take the lead. The recent history of urban warfare in Iraq should give pause, analysts say, recalling the brutal battles to evict al Qaeda from Fallujah in 2004. Soltvedt says an uprising from within is much preferable to an assault from without, and some observers predict any operation to retake Mosul wouldn't happen until early summer.

Another problem for ISIS is that coalition airstrikes and ground operations by Iraqi and Peshmerga forces appear to be whittling away ISIS' commanders -- even if claims by some US officials that half of ISIS' leadership has been taken out appear optimistic.

Among prominent casualties reported by Iraqi and Kurdish officials in the past two months are ISIS' governor for Anbar province, Abu Anas Samarraie, and Abu Muslim al-Turkmani, a member of ISIS' Shura Council, its highest policy-making body.

Soltvedt says some of ISIS' most seasoned fighters have also left Iraq -- some returning to Libya, for example. More importantly, he says, there is only a finite pool of skilled military commanders -- some of them former officers in Saddam Hussein's army, and "they will have a problem replacing them" if they are killed.

JUST WATCHED U.S. officials: Coalition killed 6,000+ ISIS fighters Replay More Videos ... MUST WATCH U.S. officials: Coalition killed 6,000+ ISIS fighters 01:44

Even where ISIS suffers defeat, there is no guarantee the Iraqi government can secure and hold territory.

The prominent role of Shia militia may yet make it difficult for Baghdad to pacify areas after ISIS retreats. During the Diyala offensive, the militia killed some 70 Sunni civilians, a local member of Parliament, Nahida al-Daini, told Reuters. Others claimed the militia had burned down houses and mosques. The Iraqi Interior Ministry denied the claims, but it's not the first time these militia have been accused of atrocities during military offensives -- and that may weaken the readiness of Sunni tribes to help the government against ISIS.

The Iraqi government has proposed bringing the militia under the umbrella of a National Guard. Oil Minister Adel Abdul Mahdi wrote on his Facebook page that it would "be possible to organize the [Shia] Popular Mobilization forces, the [Sunni] Sons of Iraq and the Peshmerga under the umbrella of the National Guard, knowing that the main goal of the latter is to prevent the emergence of militias, put all the weapons under the supervision of the state and provide backup forces when needed."

But there is plenty of resistance to the idea because such militia have often been the best guarantee of a community's security.

JUST WATCHED ISIS: Picking up where al Qaeda left off Replay More Videos ... MUST WATCH ISIS: Picking up where al Qaeda left off 02:03

In areas it liberates, the Iraqi government will have to provide security, rehabilitation and effective governance to people who -- with good reason -- don't believe Baghdad can provide any of the above.

ISIS also benefits from being able to use both Syrian and Iraqi territory as the battlefield shifts. While under pressure in northern Iraq, its forces can regroup across the border in Syria's Hasaka province. It can also use the frontier from Deir Ezzor into Iraq's Anbar province, "where it enjoys real strategic depth and the Iraqi army struggles with long supply lines," says Soltvedt. It has even begun to probe the Iraqi-Saudi border.

ISIS also controls a number of small oil fields and an arsenal of weaponry captured in both Iraq and Syria. And it still has money. Iraqi Finance Minister Hoshyar Zebari told Reuters he estimates ISIS has looted $456 million from banks in Mosul, Tikrit and Baiji since June. And it has set up a rudimentary taxation system in the main cities it controls, as well as a fearsome intelligence apparatus.

But ISIS is finding the job of controlling much harder than that of attacking. It has needed an expensive and labor-intensive mix of coercion, intimidation and policing to run Mosul, where the Iraqi government still pays the bulk of state employees' salaries.

Under pressure on several fronts, "ISIS now has to think very carefully about where it puts its forces," says Soltvedt.