“As the Islamic State loses ground around Mosul, there is a high risk of the group using chemical weapons to slow down and demoralize advancing enemy forces.” said Columb Strack, a senior analyst and the head of the IHS Conflict Monitor. “And to potentially make an example of — and take revenge on — civilian dissidents within the city.”

At least 19 of the 52 chemical attacks have taken place in and around Mosul, according to the IHS data, but the assessment noted a decline in attacks before the Iraqi-led offensive against the city.

“Mosul was at the center of the Islamic State’s chemical weapons production,” Mr. Strack said. “But most of the equipment and experts were probably evacuated to Syria in the weeks and months leading up to the Mosul offensive, along with convoys of other senior members and their families.”

The Islamic State is not the only actor in Syria to carry out chemical weapons’ strikes: The Syrian government has conducted many more such attacks.

Syrian military helicopters dropped bombs containing chlorine on civilians in at least two attacks over the past two years, a special joint investigation of the United Nations and an international chemical weapons monitor said in August.

Beginning last year, American officials confirmed the first instances of the Islamic State using sulfur mustard, a chemical warfare agent, and the presence of the mustard gas on fragments of ordnance used in attacks by the group in Syria and Iraq. Laboratory tests, which were also performed on scraps of clothing from victims, showed the presence of a partly degraded form of distilled sulfur mustard, an internationally banned substance that burns a victim’s skin, breathing passages and eyes.

Chemical warfare agents, broadly condemned and banned by most nations under international convention, are indiscriminate. They are also difficult to defend against without specialized equipment, which many of the Islamic State’s foes in Iraq and Syria lack. The chemical agents are worrisome as potential terrorist weapons, even though chlorine and blister agents are typically less lethal than bullets, shrapnel or explosives.