The student, 21-year-old Kevin Tym, admitted to deputies that he was playing with his legally owned Glock when it discharged around 2:30 p.m.,
The bullet appeared to have deflected off a TV stand and become lodged in a wall, just missing his neighbor, sheriff's officials said.
The incident occurred just hours before a memorial was planned at UC Santa Barbara for six students killed in Friday's deadly rampage through Isla Vista, when 22-year-old
Tym, an Isla Vista resident, possessed seven firearms, 1,000 rounds of ammunition and high-capacity assault rifle magazines, sheriff's officials said. He legally owned all of his firearms, they said.