A 16-year-old charged with shooting his high school principal to death didn't mean to kill him, and had brought two guns to school only to scare people, his attorney said Friday at his murder trial.

The prosecution, however, said during opening statements that Eric Hainstock's anger at Weston Schools Principal John Klang had been building. Two teenagers testified that Hainstock told them that Klang wouldn't survive homecoming.

Hainstock is charged with killing Klang on Sept. 29, the morning homecoming festivities were set to begin. Investigators say Hainstock took his father's shotgun and a revolver to school because he was upset Klang and teachers hadn't stopped other kids from teasing him.

According to a criminal complaint, after a custodian took the shotgun from Hainstock, the student took out the revolver and Klang, 49, rushed him. Hainstock shot Klang three times before the dying principal wrestled him to the ground and pushed the gun away, the complaint said.

Hainstock's lead attorney, Rhoda Ricciardi, told jurors in opening statements there's no dispute Hainstock killed Klang. But he didn't mean to, she said.

She portrayed Hainstock as a lonely country boy who was teased relentlessly, labeled a "fag" by his fellow students and beaten and abused at home.

"This case is about a troubled boy from a troubled home who found nothing but trouble at school," Ricciardi said.

District Attorney Pat Barrett maintained that Hainstock's anger toward Klang had been building for two weeks before homecoming.

Barrett noted Klang kicked Hainstock out of school for three days after Hainstock threw a stapler at his special education teacher. Klang also gave Hainstock an in-school suspension after Klang found chewing tobacco in the boy's backpack.

Alyssa Fultz, 15, testified that Hainstock told her in a church youth group meeting about a week and a half before the shooting that Klang wouldn't survive homecoming.

"He just said the principal was not listening to him and people were just being mean to him," she said. She thought little of the statement at the time, she said.

Nicole Spurgeon, 16, testified Hainstock was at her house doing homework with her brother days before the shooting when she overheard Hainstock say Klang wouldn't make it through homecoming.

Under cross-examination, Spurgeon said she thought Hainstock was a smart-aleck.

Ricciardi told jurors that Hainstock never developed coping skills and suffers from attention deficit disorder, which his father refused to medicate. She said Hainstock's father often made the boy wait on him, made him do all the household chores and sometimes beating him.

His stepbrother had sexually abused him until he was 6 years old, Ricciardi said.

Hainstock's frustrations just boiled over on Sept. 29, she said.

"He runs on emotion," she said. "He stupidly and recklessly brings guns to school."

Testimony was scheduled to continue Saturday.

Weston Schools is in Cazenovia, about 65 miles northwest of Madison.