(CNN) -- A California high school student accused of opening fire on classmates with a 12-gauge shotgun pleaded not guilty to attempted murder and other charges Monday during his arraignment in a California court.
A judge set bail at $1.5 million for Bryan Oliver, 16, and scheduled a preliminary hearing for February 21.
Oliver, appearing in handcuffs wearing an orange jail uniform and sneakers, answered "Yes, your honor" when Kern County Superior Court Judge Michael Lewis asked if he chose to waive his right to a preliminary trial.
Oliver is charged as an adult with two counts of attempted murder and three counts of assault with a deadly weapon after opening fire at Taft High School Thursday, wounding two people, one seriously. The two victims, Jacob Nichols and Bowe Cleveland, are expected to recover.
Oliver's attorney, David Torres, spoke for his client throughout the hearing, including entering Oliver's not guilty plea when the charges were read.
Before the proceeding, Torres filed a motion to bar cameras from the courtroom, concerned that publicity would compromise his client's right to a fair trial. Lewis denied the request, citing an overwhelming public interest and the prosecution's decision to try Oliver as an adult.
After Thursday's shooting in the small community of Taft, about 30 miles west of Bakersfield, Kern County Sheriff Donny Youngblood told reporters that the gunman was taken into custody after a teacher persuaded him to drop the weapon and surrender.
As the shooting unfolded, the teacher, identified as Ryan Heber, managed to evacuate his students through a back door. But instead of running, Heber had a conversation with the student gunman, authorities said.
The teacher had suffered a pellet wound to the head from one of the shots, authorities said.
Campus counselor Kim Fields helped distract Oliver as students ran. Both employees were hailed as heroes. "They stayed and probably distracted him and probably allowed students to get out of the classroom," Youngblood said.
"He (the gunman) said, 'I wasn't aiming at you,' and said the name of the student he was aiming at," he said.
When Oliver was taken into custody, he had a shotgun and about 20 rounds of ammunition, Youngblood said.
"This is a tragedy, but not as bad as it might have been," he said.
Immediately after the shooting, authorities executed search warrants at Oliver's home, less than a block from the site of the shooting. A motive has not been revealed, but authorities are investigating a theory that bullying may have played a role.
A full-time armed police officer was assigned to the school, but authorities said heavy snow in the San Joaquin Mountains prevented the officer from leaving his home.
The most seriously wounded victim was airlifted to a hospital in Bakersfield and treated for gunshot wounds to the chest and abdomen, Pruitt said.
U.S. Rep. Kevin McCarthy, whose district includes the town of Taft, expressed sympathy to his constituents. "I am deeply saddened and troubled by news of the shooting," the Republican lawmaker said.
U.S. Sen. Dianne Feinstein, whose father graduated from Taft Union High School, expressed her sadness but said the incident was a call for gun legislation reform.
"My thoughts and prayers are with the victims, and I wish them a speedy recovery," Feinstein said. "But how many more shootings must there be in America before we come to the realization that guns and grievances do not belong together?"