Baghdad: To trace the dramatic rise of the Islamic State of Iraq and the Levant, the jihadists that have spearheaded an offensive that has captured swathes of territory, just follow the money.
Thanks to a combination of racketeering, kidnapping for ransom and other criminal activity as well as donations from wealthy private individuals in the Gulf, the group has built up a financial war chest that is the envy of militant groups the world over.
And with the recent takeover of Iraq's second city Mosul, it has further bolstered its finances and capabilities, creating difficulties not only for battlefield commanders but also officials around the world seeking to stem the flow of funds to insurgents.
"There was a hell of a payday," Toby Dodge, head of the Middle East Centre at the London School of Economics, said of the financial bonanza ISIL received from the Mosul takeover.
In a matter of days this month, militants led by ISIL overran not only most of Nineveh province, of which Mosul is the capital, but also swathes of Kirkuk, Salaheddin and Diyala, and recently widened an existing front in western Anbar province.
In addition to military equipment and vehicles, which Iraqi soldiers abandoned when faced with the insurgent offensive, the assault also yielded monetary rewards.
Estimates vary as to the extent of the financial boost the Mosul takeover provided the group, but Nineveh provincial council chief Bashar Kiki told AFP the city's banks had around $400 million in cash reserves.
And within a 16-point document issued by ISIL in the wake of the takeover, the group said any money kept by "the Safavid government" -- a pejorative reference to Iraq's Shiite leadership -- would be taken over by them "for Muslims' interests".
ISIL was already making enormous sums of money in Mosul before the seizure of the city.
According to various sources, the group was raking in up to $12 million per month on extortion, ransom payments and corruption in Mosul, a city of about two million people before it was overrun.
Thanks to its military successes in neighbouring Syria, where it also operates, it has even been able to capitalise on oil sales.
"ISIL... has a long history of raising funds through criminal enterprises," said Matthew Levitt, a former deputy assistant secretary for intelligence at the US Treasury Department, the arm of the American government charged with stemming funds to militant groups.
Levitt, now director of the counter-terrorism programme at the Washington Institute for Near East Policy, said that while he expected their gains to be short-lived, "they are unique in terms of their abilities... to, through an insurgency, control territory, critical infrastructure and natural resources."
"That really is a significant departure."
Their ability to raise funds directly, without being entirely dependent on wealthy private Gulf donors -- typically a dominant source of funding for jihadist groups - creates problems for officials seeking to cut off ISIL's funding streams.
Though governments have some tools at their disposal to restrict militants' ability to raise and move finances garnered locally, they are better able to clamp down on cross-border transactions.
The Treasury Department has long warned that while traditional streams of funds for militant groups are still key, many groups are increasingly raising, and keeping, funds within the areas in which they operate.
"Many of these groups generate capital locally, often in areas subject to little if any governmental control," Treasury undersecretary for terrorism and financial intelligence David Cohen said in April.
"Without the need to move money, terrorists can avoid key international controls and, in so doing, limit governments' ability to track and disrupt their funding flows."
Cohen said, however, that relying on racketeering and other criminal efforts often engendered anger within the local populations affected, potentially undermining militant groups' long-term success.
With ISIL in particular, the group's wealth affords it the ability to not only weather efforts by governments to cut off its funding, but it can also acquire additional weapons, munitions and vehicles, thereby bolstering its fighting capabilities.
In Mosul, the group could also generate income via "legitimate" taxes, property sales and other means, potentially adding to its long-term viability.
"ISIL was already a wealthy organisation before seizing Mosul," said Charles Lister, a visiting fellow at the Brookings Doha Center.
"But with the significant material gains ISIL has recently acquired, as well as at least temporary territorial control across vast swathes of the country, the group has essentially secured its own long-term financial viability."