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

Judge Ian MacDonnell says Ayanle Hassan Ali's actions in May 2016 do not fit the intended scope of Canadian terrorism laws.

Ali had pleaded not guilty to three counts of attempted murder, three counts of assault with a weapon, two counts of assault causing bodily harm and one count of carrying a weapon for the purpose of committing an offence, all for the benefit or at the direction of a terror organization.

Ayanle Hassan Ali arrives in a police car at a Toronto court house on Tuesday, March 15, 2016. (Chris Young/Canadian Press) His lawyers had argued that because he committed his actions alone and had never been in contact with any terror groups, he should be found not guilty on the terror charges. They also argued he should be found not criminally responsible for the lesser included offences of attempted murder, assault and weapons offences.

The prosecution argued that Canadian terror laws could apply to Ali because he acted as a "terrorist group of one."

The judge ruled against the Crown's argument, saying the federal government's intention behind terrorism laws must be taken into account.

On March 14, 2016, Ali entered a Canadian Forces recruitment office in north Toronto at 4900 Yonge Street, armed with a knife, and attacked uniformed soldiers, leaving at least two with minor injuries. He was then overpowered and subdued.

According to an agreed statement of facts presented by the Crown and defence at trial, Ali repeatedly punched and slashed at one soldier, leaving the man with a three-inch gash on his arm.

Terror laws not intended for 'lone wolf acts,' judge says

Ali tried to stab or slash three other military personnel — one of whom was left with bruises and a "small, superficial nick" — before being subdued, the statement said.

"The attack was motivated by the defendant's radical religious and ideological beliefs but there is no dispute that the formation of those beliefs was in large part precipitated by mental disorder," the judge says in his decision.

"One of the beliefs that the defendant had formed in his mentally disordered state was that killing Canadian military personnel was justified because the military was fighting in Muslim lands."

After the verdict was handed down, Maureen Addie, one of Ali's defence lawyers, spoke about the case outside the courthouse, pointing out the findings of two psychiatrists, one for the crown and one for the defence.

"They both decided that his relationship with Islam became tied up with his schizophrenia and he sat alone in his room for years hearing voices ... and conflating in his mind the voices that he was hearing and the symptoms of the schizophrenia with messages of radical Islam," she said.

On Monday, MacDonnell said there is no evidence "of any connection" between Ali and any other person or group in relation to the attack.

The judge said anti-terror laws were not intended for "lone wolf acts."

That statement had Nader Hasan, one of Ali's lawyers, questioning why his client was charged with terrorism to begin with.

"I think this was a case where the Crown over-reached," he said.

"They had someone who they thought looked the part of the terrorist, when in reality they had someone who committed a terrible, terrible act, who was mentally ill and they should have proceeded in that fashion rather than over-reaching for terrorism," he said.

Ali has been in a secure treatment facility for the last two years and was remanded after the verdict was handed down. His fate will now be determined by the Ontario Review Board, which is expected to hold a hearing within the next 45 days.