The federal government failed on Friday to persuade an Appeal Court that a schizophrenic man who attacked a Canadian Forces recruiting centre was a one-person terrorist group.

In upholding the acquittal of Ayanle Hassan Ali, Ontario's top court rejected the idea that someone committing a terrorist act could legally be considered to be acting for, or in association with, a group of which the person was the only member.

"When Parliament wishes to describe conduct done for the self-interest of an actor, it uses different language," the Appeal Court ruled. "A person cannot, at one and the same time, commit an offence and be the sole member of a terrorist group for which the offence was committed."

Ali sparked fear and chaos when he went on a knife rampage at the Toronto recruiting centre in March 2016. He injured two people before being subdued. He told a paramedic that Allah had sent him to kill people.

Police found Ali had acted entirely on his own and had no ties to any terrorist organization. Nevertheless, he was charged under a section of the Criminal Code — Section 83.2 — which makes committing an offence "for the benefit of, at the direction of or in association with a terrorist group" a crime liable to life in prison.

Appeal Court: Ali could take college classes on his own

In May 2018, Superior Court Justice Ian MacDonnell acquitted him of the terror group charge. At the same time, MacDonnell found the mentally ill Ali not criminally responsible for offences that included attempted murder and assault with a weapon.

"The kind of lone-wolf criminal conduct engaged in by the defendant was not intended to be captured by Section 83.2," the judge ruled. "Parliament understood that such conduct was subject to prosecution under the existing provisions of the Criminal Code."

The prosecution, which argued at trial that Ali had acted as a "terrorist group of one," appealed only the acquittal. It called for a new trial on that issue alone.

In its submissions, the government maintained that the relevant law could apply to a "lone wolf" who commits a crime to advance the goals of his own self-constituted terrorist group. It argued MacDonnell made several errors in rejecting that interpretation, saying that excluding the solo actor would undermine Parliament's preventative purpose in enacting the anti-terrorist legislation.

The defence countered that MacDonnell was correct.

The Court of Appeal, in its analysis, said the aim of the law was to suppress terrorist activity but that interpreting the wording of any provision had to start from the principle that lawmakers did not intend to produce absurd results.

"The position the appellant advances — that the principal and the terrorist group may be one and the same person — is inconsistent with the modern principle of statutory interpretation," the appellate court found. "It is a reasonable inference that Parliament did not intend that s. 83.2 would apply to the lone wolf terrorist."

The higher court did note that other sections of the Criminal Code specifically apply to lone-wolf terrorists.

In July, the Appeal Court agreed Ali could take college classes on his own when staff at the secure Hamilton hospital where he's detained decided he was ready.