OAKLAND — After a 14-year-old boy threatened the lives of school staff members Thursday morning, police searched the boy's home and found seven loaded guns in an unlocked cabinet near his bedroom, school officials and police said Friday.

Police confiscated the weapons, which included two rifles and a shotgun, and took the boy into custody on suspicion of making terrorist threats and threats to a public employee with intent to cause deadly or bodily harm.

The boy attended Oakland Community Day School, an alternative school in the hills for middle and high school children who have been expelled. On Thursday morning, he appeared distraught, complained that he was being harassed and made threats to a case manager, district spokesman Troy Flint said. The employee immediately told the school principal, who called the police.

"I believe that the coordinated and immediate response of the (Community Day School) staff and the District's Police Force helped us maintain the safety of students and staff as well as averted a serious incident of potential violence," wrote Sam Pasarow, the school principal, in a letter to families.

Flint said the boy cooperated fully with the authorities during Thursday's investigation. He said police were told that the weapons once had belonged to an uncle who is no longer alive.

Flint said it is standard protocol for a child to undergo a mental health evaluation under such circumstances.

"It's hard to determine the student's motives or what he intended to do, but we do applaud staff for taking decisive action," he said.

Also on Thursday, another 14-year-old boy, who had been expelled from East Oakland's Madison Middle School, came onto campus after school and pointed an fake gun at two children participating in an after-school program. The child was arrested that evening and remains in police custody.

For the next two weeks, all sporting activities will take place indoors and an extra security officer will be present during the after-school program, according to a letter written by Madison's principal, Lucinda Taylor.

"We recognize that the issue of violence is not simply a Madison problem but a wider social problem, and we welcome the full input of the Madison community in grappling with this issue," Taylor wrote.

Oakland school board President David Kakishiba said the threat of weapons on campus has been a concern for years.

"The stark reality is that there are a lot of young people who have access to firearms, and a lot of people who have access to firearms," he said. "For schools, it's a real challenge."

The school district asks that anyone with information about a potential safety threat call an anonymous tip line at 510-532-4867.

Reach Katy Murphy at 510-208-6424 or kmurphy@bayareanewsgroup.com. Read her Oakland schools blog and post comments at www.ibabuzz.com/education.