The driver of an SUV that plowed through a Chicagoland mall obsessively researched the center online prior to the mayhem that sparked more than 100 terrified calls to 911, prosecutors said.

Javier Garcia, 22, has been charged with terrorism and held without bond for the Sept. 20 carnage that was caught on a now-viral video viewed more than 10 million times.

In the day before his attack, Garcia conducted 124 internet searches on Woodfield Mall in suburban Schaumburg, including the stores inside and street and aerial views, prosecutors said in Leighton Criminal Court on Sunday.

The bipolar suspect also searched a former teacher at least 21 times, although no further explanation was given in court, according to the Chicago Tribune.

Garcia had smashed his black Chevrolet Trailblazer through double doors into a Sears — prompting more than 100 calls to 911, according to the reports.

“The shattering of the glass sounded like multiple gunshots, causing patrons to initially believe that there was an active shooter in the mall,” Assistant State’s Attorney Annalee McGlone told the court. “Hysterical patrons were running and jumping in attempts to evade the vehicle’s path. Stores were locking their gates and sheltering people in the rear of stores for safety purposes.”

The SUV narrowly missed a train transporting young children through the mall before finally becoming wedged between support columns, prosecutors said, with two off-duty cops finally yanking Garcia from the car.

Garcia had driven more than halfway through the mall, but luckily no one was hit, the court heard. The damage was estimated to be more than $110,000.

Under Illinois law, the Class X felony of terrorism can apply if the suspect caused more than $100,000 in damage to any building containing five or more businesses, according to Schaumburg police.

Garcia, who also was charged with damaging property in excess of $100,000, faces a possible sentence of 20 years to life, according to the reports.

Cook County Judge Mary Marubio denied bail requests, calling Garcia a “danger to the community,” the Chicago Sun-Times said.

Outside court, Garcia’s attorney, Amil Alkass, called the terrorism charge “a little aggressive” and told the court that his client is being treated for bipolar disorder and paranoid schizophrenia.

“He’s definitely not a terrorist,” Alkass told the Chicago Sun-Times. “There was nobody targeted.”

With Post wires