A teenager who wounded a fellow student before killing himself at a suburban Denver high school entered the building with a shotgun, a machete, three Molotov cocktails and ammunition strapped to body, likely intending to track down a librarian who had disciplined him, authorities said Saturday.

After firing a round down a hallway, Karl Pierson, 18, shot a fellow student who happened to be sitting nearby with a friend as he headed toward the library. Claire Davis, 17, was shot in the head at point-blank range and remained hospitalized Saturday in critical condition.

Pierson set off one of the devices, but killed himself just one minute and 20 seconds after entering the building because he knew a sheriff’s deputy assigned to the school was closing in, Arapahoe County Sheriff Grayson Robinson said at a news conference.

Pierson’s original target was thought to be a librarian who coached the school’s speech and debate team. The librarian, whose name was not released, had disciplined the teen in September for reasons that haven’t been disclosed.

The librarian was able to escape the school unharmed, Robinson said.

The sheriff also said Davis appeared to be a random target. Based on Pierson’s arsenal, Robinson believes the teen intended to hurt many others. “His evil intent was to harm multiple individuals,” he said.

Pierson legally purchased his shotgun at a local store a week before the shooting and bought the ammunition the day of the shooting. Anyone 18 and older is allowed to buy a shotgun in Colorado; only those over 21 can legally buy a handgun.

According to Robinson, Pierson fired another round down the hallway after wounding Davis. He then entered the library, fired one shot and detonated one Molotov cocktail, which caused three bookshelves to catch fire. After that, he fired a fifth round, ran to a corner and shot himself.

Students and a teacher described Pierson as a smart and sometimes goofy student who often talked about his beliefs during class, sometimes even debating his teachers. They said he was outspoken about his Communist-leaning political views.

They also said he was an Eagle Scout who finished at the top of speech competitions.

Pierson competed in extemporaneous speaking — in which students prepare short speeches on current events — in the National Forensic League’s national tournament in June in Birmingham, Ala. He didn’t advance to the elimination rounds, the league said.

Zach Runberg, 18, a fellow senior from Pierson’s English class, said the teen was funny and made intelligent jokes.

“He would speak for himself,” Runberg said. “He would not be afraid to tell someone how he feels.”

Pierson, whose parents were divorced, lived at least part of the time with his mother in a neighborhood in suburban Highlands Ranch. The front door of the home was covered with plywood Saturday after authorities conducted a search overnight.

Challon Winer, who lives across the street from Pierson’s home, said he often would see the teen mowing the lawn or shoveling snow from the driveway.

In recent days the teen’s schedule appeared to change, and he left the house a little later than usual, Winer said.

Winer said Pierson’s mother, Barbara Pierson, has worked with the Neighborhood Watch group and sometimes sent emails reminding residents about safety precautions.

Meanwhile, the family of the wounded student issued a statement Saturday saying she is suffering from severe head trauma and asking for privacy. Friends and well-wishers posted prayers and comments for Davis on Twitter, while some students collected money to help pay for her medical expenses.

Senior Chris Davis said he and others organized the effort in hopes of helping his classmates and the larger community heal.

“I feel like it’s going to make us a stronger senior class and school as a whole,” Chris Davis said. “Everyone went through it, and we all know people experienced it in their own way, and we just need to be there for everybody.”

Chris Davis is not related to Claire Davis, but his locker is right next to hers. He described Claire Davis as someone who loves horses, has a lot of friends and always seems happy.