After a 31-year-old man used a cargo truck to crush 86 people to death on the promenade in Nice, France, his distraught father rushed to tell reporters his son had once suffered a nervous breakdown.

When Omar Mateen used a Sig Sauer MCX semiautomatic rifle to gun down 49 people at an Orlando nightclub, relatives described him as bipolar.

And in Canada this week, after a 29-year-old man opened fire on a street full of cafes, hitting 15 people and killing two, his family issued a statement: Faisal Hussain, it said, had long struggled with mental illness.

The Islamic State offered another explanation: All three men, it claimed, were its soldiers.

Not long after Mr. Hussain’s family issued its statement, the Islamic State’s news agency put out a bulletin claiming the attacker had been inspired by the terrorist group — and reigniting a debate about whether an individual who is mentally ill can truly be said to act at the behest of a terrorist group.