A man who attacked Canadian soldiers at a military recruitment center in Toronto has been acquitted of terror-related charges and found not criminally responsible for lesser charges due to mental illness.

Judge Ian MacDonnell said Monday Ayanle Hassan Ali’s actions in May 2016 don’t fit the intended scope of Canadian terrorism laws. Three soldiers were hurt when he slashed at them with a kitchen knife. None of the injuries were serious.

Both the prosecution and defense agreed Ali had a serious mental illness. His lawyers had argued he should be found not guilty on the terror charges because he committed his actions alone and hadn’t been in contact with terror groups.

They also argued he shouldn’t be convicted of the lesser included charges of attempted murder, assault and weapons offences.

Montreal-born Ali, 27, was heard saying “Allah told me to come here and kill people” during the incident. Three soldiers were wounded before a group of six to eight soldiers managed to subdue him.

