Far from the force that swept across Iraq in mid-2014 and seized control of nearly a third of the country, ISIL today has been weakened significantly, relegated to just a few dozen square kilometres of ground, with manpower in the low thousands.

The Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group was removed last week from yet another stretch of the country, the latest in a series of blows to the once-powerful armed group. The town of Hawija, which ISIL had held since 2014, lies around 240km north of Baghdad and was its last urban stronghold in Iraq.

The offensive began on September 21 and was expected to be tough going. Within just two weeks, jubilant Iraqi forces and members of the country's Popular Mobilization Units (PMUs) had hoisted their flags in squares and roundabouts. ISIL crumbled rapidly, with hundreds of fighters fleeing north towards Iraq's Kurdish region to surrender.

Iraqi Prime Minister Haider al-Abadi described it as a triumph "not just for Iraq but for the whole world".

July marked the beginning of the end for ISIL's position as a territory-dominating group in Iraq. It was then that the country's second-largest city, Mosul, was finally retaken after nine months of brutal fighting.

Nearby Tal Afar, a onetime hotbed of hardliners, was swiftly liberated soon afterwards. Coupled with recent events in Hawija, these losses have underscored the fact that the group is no longer able to wage large-scale warfare, analysts say.

But it is not yet the end of ISIL in Iraq.

Even now, the group still holds part of Anbar, the Iraqi province that was once almost entirely under its control. Security forces have clawed back cities such as Ramadi and Fallujah, and ISIL fighters are now confined to a swath of desert lining the border with Syria, including the town of al-Qaim. This is the focus of an ongoing operation that began two days before Hawija and also involves Iraqi security forces, supported by the US-led coalition, PMUs and local tribal fighters.

Much of the area is open desert or farmland that favours the well-equipped offensive forces. Al-Qaim itself, however, is more built-up and around 1,500 fighters are stationed there, according to coalition estimates.

ISIL also holds the other side of the border, its main remaining area of strength, but pressure is mounting from the US-backed Syrian Democratic Forces (SDF) - which have almost retaken ISIL's de facto capital of Raqqa, Syria - and pro-government forces backed by Iran and Russia.

Eradicating this last pocket is not expected to be easy: "While ISIS militants have been surrendering in mass numbers, most recently in Hawija, we still plan on a tough fight in their few remaining holdouts, Rawah and al-Qaim," coalition spokesman Colonel Ryan Dillon told Al Jazeera.

When the battle ends, Baghdad will have further damaged what is left of ISIL's supply lines and reclaimed the borders that the group announced it had broken back in 2014.

Military defeats have not stopped ISIL from conducting devastating attacks. In mid-September, it claimed responsibility for suicide and car bombings in southern Nasiriyah that killed more than 80 people.

The group will likely remain a potent threat, launching attacks and biding its time until it feels strong enough to return in some form, said Michael Knights, an Iraq specialist with the Washington Institute for Near East Policy.

"ISIL is within a few months of controlling no cities in Iraq and no large towns even," Knights told Al Jazeera. "But in some areas that were liberated more than 30 months ago, such as Diyala province, ISIL has already bounced back as a strong insurgency. So the cycle is already starting again, just like in 2011 when they started growing stronger last time. The trick is to break the cycle."

Whether or not the Iraqi government is able to do so likely depends on post-war reconciliation and reconstruction efforts. But political stability is in jeopardy amid recent acrimony between Baghdad and the semi-autonomous Kurdistan Regional Government in Erbil, which last month pushed ahead with a non-binding independence referendum despite fierce opposition. Relations have hit a new low, and al-Abadi has threatened to "impose Iraqi rule" on the Kurdish region if the referendum results are not cancelled.

The remaining military operations are unlikely to be affected by the spat, but a lack of coordination between the two regions and territorial disputes could offer ISIL an opportunity to recover.

"The situation certainly could have an impact on the fight against ISIL," Michael O'Hanlon, a senior fellow at the Brookings Institution, told Al Jazeera. "But [it would be] less in battlefield terms, where the state now has commanding superiority, and more in political terms, where a return to sectarianism could create worrisome dynamics and failed rebuilding efforts."

Two weeks ago, ISIL released an audio recording purported to be from the group's leader, Abu Bakr al-Baghdadi, who has been rumoured killed on multiple occasions. The 46-minute recording was his first in a year and seemingly designed to energise the remaining forces.

In it, al-Baghdadi praised the fighters who died in Mosul and "did not give up except over their skulls and body parts". He ended with a vow to continue fighting and a call for attacks on the "headquarters" and "media centres" of ISIL's enemies.