As Iraqi forces close in on Mosul, the possibility of chemical weapons use looms large.

It feels like this is the beginning of the end of the campaign to liberate Mosul from the Islamic State of Iraq and the Levant, and some seem to be predicting that ISIL fighters will drift away at some stage to fight another day in Syria.

Those more than 100 suicide bombers seen in the first week of the assault and those who set light to al-Mishraq chemical plant would suggest this is not the case and that ISIL (also known as ISIS) will throw the kitchen sink at the coalition to stave off losing Mosul.

With ISIL’s Iraq strongholds gone, so is most of the caliphate, no doubt with a final battle in Raqqa – but the war hinges on Mosul.

Chemical weapons expert discusses ISIL ‘chlorine attack’

In this forthcoming apocalypse ISIL will fight with every means available, and this will include the use of their extensive chemical weapons capability.

Built up over the past two years, ISIL has been making mustard agent and fashioning toxic industrial chemicals into improvised weapons, which it has been testing by attacking the Peshmerga of Iraqi Kurdistan.

More than 20 times in the past 12 months ISIL has fired mortars and rockets at Peshmerga troops in the Makhmour area containing the “blister agent” mustard gas and chlorine, a choking gas. Chlorine and mustard gas were first developed in World War I as chemical weapons and both can be fatal if gas masks are not used.

These chemicals have killed few but injured many, and as General Sirwan Barzani, commander of the Peshmerga Black Tigers of Sector 6, told me in August near Gwer: “I know chemicals are not as dangerous as bombs and bullets, but my men have few gas masks and they fear chemicals.”

A toxic legacy

The Kurds know all about chemical weapons; it was Saddam Hussein who tried to exterminate them in the 1980s in the Anfal campaign, killing up to 100,000; and most notably 5,000 in a single day at Halabja on March 16, 1988, using the deadly nerve agent sarin.

Bashar al-Assad used the same chemical weapon in Ghouta on August 21, 2013 to horrific effect. It is now Saddam’s Baathist scientists who are developing ISIL’s chemical capability.

On both occasions the death toll was very high because it was innocent civilians who were attacked who had no way or knowledge to save themselves.

To underestimate ISIL's capacity for terror is an error, and to underestimate its ability to conduct chemical warfare would be very unwise.

The Ghouta attack in Syria helped Assad to stay in power for three years, and prevented Damascus from falling.

His forces have also prevented ISIL from taking the strategic military base at Deir Az-Zor for the past two years with the use of chlorine barrel bombs. This, I believe, has had a profound effect on ISIL when planning their defence of Mosul.

The first element of the defence of Mosul was seen last week when ISIL set fire to al-Mishraq chemical plant 30km south of Mosul.

This is putting huge amounts of deadly hydrogen sulphide and sulphur dioxide into the atmosphere, which is mixing with poisonous fumes from oil fires to produce a deadly cocktail.

OPINION: Remembering Halabja chemical attack

To date, several are reported dead and 1,000 injured. The cloud is currently sitting over the military base Qayyarah, forcing the United States military personnel into gas masks and others indoors.

From a military perspective this is a good move by ISIL, as it cuts through the advancing Iraqi army, not all of whom have gas masks, as they march towards Mosul.

If this toxic cloud were to move eastwards to more populated areas this could be of grave concern. Saddam Hussein set fire to Mishraq in 2003, as the US coalition advanced into Iraq. It burned for two months, caused thousands of casualties, and allegedly burned a hole in the ozone layer.

The capacity for terror

To underestimate ISIL’s capacity for terror is an error, and to underestimate its ability to conduct chemical warfare would be very unwise.

ISIL scientists have developed an extensive if crude chemical arsenal including mustard agent, chlorine and other toxic industrial chemicals.

OPINION: The battle for Mosul – The beginning of the end

Chemical weapons are extremely effective for defending built-up areas and cities, as they put attackers into gas masks which make fighting “hand-to-hand” exceedingly difficult.

And if they don’t have masks, as some Peshmerga and Iraqi army don’t, chemical weapons could make them think twice about entering the city.

It is the psychological effect of these abhorrent weapons which is of most use to the defender; and it is this fear which must be overcome by the attacker.

This could be achieved by good training and leadership, which the coalition must continue to provide to Baghdad and Erbil.

Even if this fear is overcome and Mosul is conquered militarily, the final battle will not be won unless we invest into a vast humanitarian programme.

The millions of souls left who have had to endure two years of ISIL brutality will not thank us if we cannot feed and clothe them, give them water and electricity, and prevent a potential environmental disaster left behind as ISIL’s toxic legacy.

Executing these vital tasks will involve the support of NGOs and those right behind the frontlines. There will undoubtedly be all types of toxic nasties left behind by ISIL, and we must ensure that these NGOs have the wherewithal to deal with them.

Hamish de Bretton-Gordon is a chemical weapons adviser to NGOs working in Syria and Iraq. He is a former commanding officer of the UK Chemical, Biological, Radiological and Nuclear Regiment and NATO’s Rapid Reaction CBRN Battalion.

The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial policy.