A man who prosecutors accused of killing one tourist and injuring nearly two dozen others when he mowed down pedestrians in Times Square five years ago was found not responsible by a jury on Wednesday due to mental illness. 

Richard Rojas, a 31-year-old man who has been diagnosed with schizophrenia and was hearing voices during the attack, will now qualify for an open ended "involuntary mental commitment" instead of a lengthy prison sentence, the judge said. 

More than 20 people were wounded and 18-year-old Alyssa Elsman, who was visiting New York City with her family from Michigan, was killed in the attack. 

Elsman’s younger sister Eva, who was 13 years old at the time, testified that she sustained broken ribs, a collapsed lung, a broken leg, and other wounds. 

The Elsman sisters' mother, Jyll, told the court that it sounded like "somebody just floored it" during the attack and "was so loud." 

"That is the last thing that I remember before everything went black," she testified last month.  

NYPD OFFICER ASSAULTED BY HOMELESS MAN GRABBING FOR COP'S GUN AFTER ADAMS ORDERS SOLO SUBWAY PATROLS

Rojas's defense attorney, Enrico DeMarco, argued at the trial that his client was "suffering from schizophrenia" and his "mind had deteriorated so much that he lost control."

"The evidence is going to show he met the criteria for legal insanity," DeMarco said last month. 

He told reporters outside court after the verdict on Wednesday that the jury's decision was "right and humane."

Alyssa Elsman Times Square attack victim

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 crowd of pedestrians in New York's Times Square. (Timothy A. Clary/AFP via Getty Images)

DeMarco played a video during the trial of Rojas getting out of the car after the attack and banging his head on the ground as he yelled, "What happened?… Oh my God, what happened?"

WEEKEND CRIME WAVE: DOZENS WOUNDED IN MAJOR CITY BLOODSHED AS CHICAGO, NEW YORK CITY, DC REPORT MASS SHOOTINGS

Rojas's family members testified that the 31-year-old descended into a state of paranoia after being discharged from the Navy in 2014 for assaulting a cab driver.  

Prosecutors acknowledged that Rojas was having a psychotic episode, but argued that he was "in full control of his car" during the "horrific, depraved act."

New York city Times Square attack

A smashed car sits on the corner of Broadway and 45th Street in New York's Times Square after driving through a crowd of pedestrians (Fox News/Alex Vros)

CLICK HERE TO GET THE FOX NEWS APP

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

DeMarco did not immediately respond to a request for comment about the case on Wednesday evening. 

The Associated Press contributed to this report.