A Nevada middle school student shot and killed a math teacher on Monday, then fatally shot himself in front of children who were gathering for class at the beginning of the school day, the authorities said.

The teacher was killed while trying to protect other students from the armed boy, the authorities said. The Associated Press reported that the teacher was identified as Michael Landsberry by his sister-in-law, Chandra Landsberry. She said he was a military veteran with a wife and two stepdaughters.

The boy, whose name and age have not been released, wounded two students during the attack, but hospital officials said their injuries were not life-threatening. On Monday afternoon, one of the students was listed in serious condition and the other was in fair condition, hospital officials said.