TORONTO -- A pyschiatrist testifying for the prosecution says the man behind Toronto's van attack compartmentalized his thoughts like a pedophile.

Dr. Scott Woodside says Alek Minassian was able to push out thoughts of his victims like a sexual predator pushing out the harms he would cause to a child.

Woodside says that helped Minassian commit his attack, which killed 10 people on April 23, 2018.

The 28-year-old Minassian from Richmond Hill, Ont., has pleaded not guilty to 10 counts of first-degree murder and 16 counts of attempted murder.

The defence argues Minassian should be held not criminally responsible for his actions due to autism spectrum disorder.

Minassian's state of mind is the sole issue at trial since he has admitted to planning and carrying out the attack.

The central question in the case is whether he knew what he did was morally wrong.

The defence argues Minassian did not, due to a deficit in empathy and an inability to understand the damage the attack wrought, which stems from his autism spectrum disorder.

Woodside has previously said Minassian knew his actions were morally wrong.

"In this case, his decision was not about reasoning, this was something he very much wanted to do whether right or wrong," Woodside said.

Woodside, a forensic psychiatrist at Toronto's Centre for Addiction and Mental Health, compared Minassian's compartmentalization to sex offenders he's assessed.

The sex offenders had a strong desire to have sex with children, but knew that would harm the victims, he said.

"They work quite actively to put those thoughts out of their heads," Woodside said.

"They remain aware of what they're doing is likely to have a negative impact on others."

Woodside said Minassian's ultimate motivation for the attack was notoriety, which he said demonstrates the young man knew the attack would be viewed by the public as a despicable act.

He has said Minassian was focused on kill counts and wanted a "high score" and had hoped for 100 deaths, but was satisfied with 10 deaths.

Woodside is the final witness in the trial that is taking place by videoconference due to the pandemic.

Justice Anne Molloy is presiding over virtual court without a jury.

This report by The Canadian Press was first published Dec. 14, 2020.