An 18-year-old who wounded a fellow student before killing himself at a suburban Denver school had entered the building with a shotgun, a machete and three incendiary devices in his backpack and had ammunition strapped to his body, authorities said Saturday.

Arapahoe County Sheriff Grayson Robinson said Karl Pierson was probably motived by retaliation against a faculty member — likely a librarian at the school — when he opened fire Friday at Arapahoe High School. Robinson said it appears that the librarian was the initial target but that Pierson planned to hurt multiple people.

Robinson said at a news conference that the teen bought the pump-action shotgun legally Dec. 6 at a local store. Anyone older than 18 is allowed to buy a shotgun in Colorado; only those over 21 can legally buy a handgun.

Also Saturday, Robinson identified the wounded student as 17-year-old Claire Esther Davis. Robinson said Davis was seated with a friend near the door Pierson used to enter the school when Pierson shot her at point-blank range.

“She is an innocent young lady, and she was an innocent victim of an evil act of violence,” he said. Davis remained hospitalized Saturday in critical condition.

Robinson said Pierson bought ammunition Friday and went to the school armed with multiple rounds. The sheriff said he thinks the teen intended to harm many more people but ended up killing himself less than two minutes after entering the school because he knew a sheriff’s deputy was closing in.

Quick-thinking students at Arapahoe High alerted the targeted educator, who quickly left the building, officials said, and the strategic response by police on the eve of the anniversary of the Newtown, Conn., massacre appears to have averted more bloodshed.

About a half-hour after wounding the girl, Pierson was found dead in the school, apparently of a self-inflicted gunshot wound.

Two other students were treated for minor injuries and released.

Robinson said Pierson, a senior who participated in debate activities, had had an altercation with the educator, but the sheriff did not provide details.

— Associated Press