The UC Santa Barbara campus. Via Wikimedia Commons A University of California at Santa Barbara student was arrested when he accidentally fired a handgun at his apartment wall, officials said on Wednesday, in the same college town still grieving after last week's killing spree that left 6 dead.

Kevin Tym, 21, was playing with his legally owned Glock 17 9mm handgun on Tuesday afternoon in his Isla Vista, California apartment when he accidentally fired the gun, the Santa Barbara County Sheriff's Office said in a statement on Wednesday.

The statement said the bullet pierced his neighbor's wall and ricocheted off a television set barely missing the resident inside.

Police searched Tym's apartment and found 7 legally-owned firearms, roughly 1,000 rounds of ammunition, and high capacity assault rifle magazines, the statement said. All the guns and bullets were taken by police, and Tym was arrested for negligent discharge of a firearm and possession of high capacity magazines. He is being held on $2,500 bail, the statement said.

Last Friday, the Isla Vista community was the scene of a deadly shooting rampage launched by 22-year-old Elliot Rodger, who killed six university students and injured over a dozen more. The University of California at Santa Barbara, which is headed into its final exams, canceled classes on Tuesday for a day of mourning.

The Sheriff's statement did not indicate that these two incidents were connected.