NEW YORK (AP) — A man who drove his car through crowds of people in Times Square in 2017, killing a Michigan teen and maiming helpless pedestrians, was cleared of responsibility Wednesday because of mental illness.

A jury in New York City accepted an insanity defense claiming Richard Rojas was so psychologically disturbed he didn’t know what he was doing.

READ MORE: Michigan Matters: Theaters & Politics

The judge has said the finding would qualify Rojas for an open-ended “involuntary mental commitment” instead of a lengthy prison term.

A photo of victim Alyssa Elsman of Portage, Michigan is posted on a baricade in Times Square May 19, 2017, the morning after Richard Rojas crashed his car into a a crowd of pedestrians in New York’s Times Square killing one and injuring 22 people.
A US Navy veteran who plowed a car into pedestrians in New York’s Times Square, killing a woman and injuring 22 other people, has been charged with murder and attempted murder, police said Friday. / AFP PHOTO / TIMOTHY A. CLARY (Photo credit should read TIMOTHY A. CLARY/AFP via Getty Images)

Rojas, 31, was accused in an attack that injured more than 20 people and killed Alyssa Elsman, 18, of Portage, who was visiting the popular tourist destination with her family.

The jury was instructed that if it found prosecutors had proven their case, it also had to decide whether or not he “lacked responsibility by reason of mental disease or defect.”

The trial, which began early last month, featured testimony from victims who suffered severe injuries from what prosecutors labeled “a horrific, depraved act.”

On the defense side, family members testified how Rojas descended into paranoia after he was kicked out of the Navy in 2014.

That Rojas was behind the wheel of the car was never in doubt. Multiple security videos showed him emerging from the vehicle after it crashed. That put the focus of the case on his mental state.

READ MORE: CDC: New Listeria Outbreak Tied To 23 Illnesses, 1 Death

Alyssa Elsman. (Photo: Portage Central High School)

In his closing argument, prosecutor Alfred Peterson conceded that Rojas was having a psychotic episode, including hearing voices, at the time of the rampage. But Peterson argued Rojas showed he wasn’t entirely detached from reality by maneuvering his vehicle onto the sidewalk and driving with precision for three blocks, mowing down people until he crashed.

One victim’s pelvis was separated from her spine. Doctors were certain she would die, but she somehow survived. Elsman’s younger sister Eva, then 13, testified during the trial about her own injuries: broken ribs, a collapsed lung, a compound leg fracture and other wounds that kept her in the hospital for weeks.

“The defendant made a decision that day,” the prosecutor, Peterson, said. “He made a choice. … He went to the ‘crossroads of the world,’ a high profile place where everyone knows there’s lots and lots of people.”

Once there, he was “in full control of his car,” he added.

Defense lawyer Enrico DeMarco told jurors “there should be no doubt” his client met the legal standard for an insanity finding. The evidence, the lawyer said, showed Rojas “lacked a substantial capacity to know what he was doing was wrong” because of an underlying illness — schizophrenia, as diagnosed by a defense psychiatrist who testified.

DeMarco played a videotape in the courtroom of Rojas jumping out of his car after it slammed into a sidewalk stanchion. Rojas could be heard yelling, “What happened? … Oh my God, what happened?” as he was being subdued, and could be seen banging his head on the ground.

MORE NEWS: Troubling Arsenic Levels Found At Some Detroit Demolition Sites

© 2022 Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.