As ISIS lost one of its last villages in Iraq, Brett McGurk, the US special envoy to the coalition battling the group, took to Twitter for a victory lap. The organization’s 'phony "caliphate"', he wrote, is 'coming to an end'.

It is true that ISIS has lost the vast majority of its territory, which at its peak in 2014 included about one-third of Iraq and half of Syria. Once dubbed 'the world’s richest terrorist organization' by the United Nations, it has also lost an estimated 80 per cent of the funds it acquired by conquering territory and mimicking the functions of a state, collecting taxes and tariffs from the citizens under its control.

Rumors of its demise, however, have been greatly exaggerated. For all of the victories that the Iraqi government and its international allies have won on the battlefield, they have so far been unable to deal similar damage to the jihadi organization’s financial capabilities. Indeed, the corrupt war economies of Iraq and Syria will allow ISIS to continue on and finance a dangerous insurgency. If the caliphate is to be truly eradicated, its opponents must find ways to starve it of cash.

ISIS has smuggled an estimated $400 million out of Iraq and Syria during its recent retreat, according to an Iraqi legislator who sits on a parliamentary committee to gather facts on Mosul’s fall and who is close to figures in the organization. With that cash, ISIS has both smuggled money out of Iraq and invested in local Iraqi markets.

The Iraqi government’s failure to exert control over the country’s informal economy predates the US-led war in 2003. In the 1990s, grueling international sanctions on oil and gas exports led Saddam Hussein’s regime to expand smuggling networks across the borders with Turkey, Syria and Jordan.

ISIS understood Baghdad’s lack of control over the informal economy — and exploited it. It seized the old smuggling routes when it rampaged across Iraq and Syria in 2014, making $1 million or more per day from the war economy. The organization trafficked priceless antiquities, gold and oil — and took a cut from every sale. Evidence points to the complicity of political parties and well-connected individuals from Iraq and neighbouring countries in fuelling this black market.

As ISIS returns to its insurgent roots, it has invested at least $250 million in legitimate businesses. Both in Baghdad and in recently liberated areas, it is relying on middlemen who are inspired not by its ideology but by the prospect of economic gain. Many of the middlemen are tribal leaders or businessmen who have clean records and can hide their links to the terrorist organization. They are given a lump sum of cash to invest in a given business, and ISIS then takes a cut from the profits.

These front companies include car dealerships, electronics shops and pharmacies — but the business of choice is currency exchanges. According to the Central Bank of Iraq, hundreds of small ISIS-linked exchange houses now operate in Baghdad. Such businesses allowed the group to convert their Iraqi dinars into American dollars — a currency that will have further reach across the globe. In 2014 and 2015, ISIS participated in the Iraqi central bank’s currency auctions, which provide banks and currency exchange houses with access to US dollars in cash and help Baghdad stabilize the exchange rate. Yet it took the Iraqi government roughly a year to prevent the group’s participation.

The Iraqi ministries of interior, defence, finance and foreign affairs; the central bank; the prime minister’s office; and the counterterrorism service are all trying to block the financing of terrorism — but they remain institutionally weak and rarely cooperate with each other. Coordination has been hobbled by political rivalries and corruption among the political elites. Members of this elite class personally profit from the black market — a member of parliament who belongs to an anti-corruption committee once opined that 'everybody is corrupt', including himself — so they lack any incentive to crack down on it.

For the group's leaders, the structural economic problems that afflict Iraq represent a lifeline. They will continue to profit from the trade of illicit drugs, antiquities and arms, and also turn to kidnappings as a source of revenue — a tactic they relied on heavily in the organization’s early days more than a decade ago. They are banking on the fact that the country’s thriving black market, if left unchecked, will allow them to transform their organization from a pseudo-state into a vicious insurgency.

It’s time for Iraq and its allies to prove them wrong. The battle to defeat ISIS is, at the end of the day, a struggle to build an Iraqi state that is no longer hobbled by corruption and economic weaknesses. If the Trump administration really wants to bring ISIS to its knees, it not only must help Baghdad kill terrorists but also bankrupt them.

This article was originally published by Foreign Policy.

To comment on this article, please contact Chatham House Feedback