The attacks occurred in both Iraq and Syria, the officials said, though they did not say which of the suspected attacks had been confirmed as having involved sulfur mustard or whether the artillery attacks on Marea were among them.

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, and they are worrisome as potential terrorist weapons, even though chlorine and blister agents are typically less lethal than bullets, shrapnel or explosives.

Chlorine is commercially available as an industrial chemical and has been used occasionally by bomb makers from Sunni militant groups in Iraq for about a decade. But it is not known how the Islamic State would have obtained sulfur mustard, a banned substance with a narrow chemical warfare application, the officials said, and it remains part of a puzzle that the United States and other governments have not solved.

Both the former government in Iraq and the current government in Syria previously possessed chemical warfare programs.

Abandoned and aging chemical munitions produced by Iraq during its war against Iran in the 1980s were repeatedly used in roadside bombs against American forces during the occupation that followed the 2003 American invasion of Iraq. But one official said the types of ordnance linked to the Islamic State so far have not matched known chemical ordnance in the former Iraqi inventory.

The official said the attacks have been perplexing, as they have been geographically scattered and have varied in their delivery systems, suggesting that the Islamic State had access to, and was experimenting with, different types of rockets and shells configured to carry chemical warfare agents or toxic industrial chemicals.

One theory is that the militants were manufacturing a crude mustard agent themselves, both officials said. That would be a technically difficult task, one of them said, as would loading and sealing any agent in warheads or shells that could be fired safely and accurately.

Another theory was that the Islamic State acquired sulfur mustard from undeclared stocks in Syria, either through capture or by purchasing it from corrupt officials, though both American officials said that this theory was not at present widely held by American analysts.