After pledging to improve his falling grades, Shane Halligan ate breakfast with his family, went off to school, and took his own life.

The 11th-grader was an Eagle scout and volunteer firefighter who planned a career in the military. But the poor grades he brought home on his report card Monday led his parents to warn him to focus on school.

"The picture that's emerging is he was despondent over (the fact) his grades are down, his parents are taking appropriate steps to limit extracurricular activities to get the grades up, and he saw the things that he felt were important in his life being taken from him," Montgomery County District Attorney Bruce L. Castor said.

After the family breakfast Tuesday, Halligan retrieved a rifle from a locked cabinet — his father kept the two keys — and found high-powered ammunition in the basement, Castor said.

At Springfield Township High School, the teenager took the weapon out of a large duffel bag after first period and fired several shots into the ceiling and high on the walls in a hallway, prompting students to scatter. He then walked to another hallway and shot himself in the head, police said.

"There was no question the only person he intended to do violence to was himself," because it would have been impossible to accidentally miss so many students in the crowded hallway, Castor said.

The police station is next door to the high school and officers were on the scene almost immediately. Officers in the building heard a single shot and found the 16-year-old boy dead in the hallway.

All students were evacuated to an adjacent middle school and all the district's schools were locked down, said Laura Feller, a spokeswoman for the Springfield Township School District. Parents trickled to the school later Tuesday morning to pick up their children.

The high school was to remain closed on Wednesday, officials said.

Nearly three months ago, a 10th-grader at the school just outside Philadelphia was arrested for allegedly bringing in a loaded gun. The boy showed the gun to another student, and word soon got to a teacher and then a security officer, officials said. Police found the student and arrested him after he had left campus on foot.

Superintendent Roseann Nyiri said officials considered installing metal detectors after that, but they felt it was an isolated incident. Instead, they decided they would try to screen for and help children who are potentially at risk.

Shane Halligan left behind a note for his family, but authorities did not disclose its contents.

His father talked briefly to reporters outside the family's home, which was decorated for Christmas.

"We see this on the news and wonder how it could happen. It doesn't happen in our family," John Halligan said, according to The Philadelphia Inquirer. "I'm at a loss."