An 18-year-old student authorities say had researched school shootings and had an arsenal of guns at his home was charged Wednesday with planning to attack a Southern California campus.

Sebastian Villasenor of Eastvale was charged with five counts of attempted murder and one count of attempting to make criminal threats, the San Bernardino County District Attorney's Office said in a statement. He remained jailed.

It wasn't immediately clear whether he had a lawyer to speak on his behalf. The DA’s office said it didn’t have information on whether Villasenor had representation but added that a lawyer would appear or could be appointed at his scheduled Thursday arraignment.

ATLANTA HIGH SCHOOL SHOOTING INJURES 4 STUDENTS AFTER DISMISSAL, DISTRICT SAYS

Investigators discovered that Villasenor "had every intention of carrying out a school shooting at the Ontario Christian High School" in Ontario, city Police Chief Michael Lorenz said at a news conference.

Ontario is 46 miles east of Los Angeles.

Villasenor, who didn't have any criminal record, was arrested on Saturday after a classmate reported he "had been showing signs of being fixated on school shootings and had access to weapons," the chief said.

California Fox News graphic

An 18-year-old student was charged with five counts of attempted murder and one count of attempting to make criminal threats for planning a school shooting on a Southern California campus. (Fox News)

School Principal Ben Dykhouse said he was grateful to God, the police and to the student "who was brave enough to say something when they saw something that was off."

The police chief said Villasenor was "obsessed" with school shootings, researched tactical supplies and how long it would take police to arrive at the school and was in the process of choosing a date for his attack.

Police who went to Villasenor's home found seven rifles, two revolvers, another handgun and a shotgun along with more than 1,000 rounds of ammunition, Lorenz said.

CLICK HERE TO GET THE FOX NEWS APP

Although he didn't have a "hit list," police believe that Villasenor was focusing on five Ontario students as intended victims and "contemplated" a sixth victim, based on interviews regarding his social interactions with the students, the chief said.

Lorenz said investigators determined that Villasenor wasn’t "bullied or harassed" but had difficulties "forming relationships with other students and in his social interactions."

Lorenz said investigators believe Villasenor may have planning a shooting around April 20, which is the anniversary of the 1999 attack at Columbine High School in Colorado that left 15 people dead, including the two shooters.