David Belnap stood on his North Carolina college campus aching from the latest US school shooting as he held a candle and wore a homemade T-shirt with “Riley Howell is a hero” written on the back.

Howell died in his classroom on Tuesday at the University of North Carolina-Charlotte, charging and tackling a gunman who would kill him and another student and wound four others with a legally-obtained pistol, authorities said.

The gunman is due to appear in court on Thursday.

David Belnap in Charlotte North Carolina Wednesday. Photograph: Skip Foreman/AP

Howell’s decision to fight for the lives of others fit his character, Belnap said on Wednesday at a candlelight vigil on campus the night after the shooting.

“It seems very much like something he would do. I want that to be his legacy, that he lost his life to protect those he cared about,” the sophomore said about his friend.

Howell, 21, likely went through the same active shooter drills as countless other students of his generation. They were taught to run away if they can, hide if they can’t run and if the horrible situation arises where a gunman prevents those two choices, fight for their lives.

Howell knocked the assailant down, buying enough time for the first officer in the classroom to capture Trystan Andrew Terrell, said Kerr Putney, Charlotte-Mecklenburg police chief.

The gunman had a lot of ammunition and while detectives aren’t sure if he was targeting anyone specifically, they know he picked out the Kennedy Building and gave no indication he was going to stop shooting before Howell charged, Putney said.

“His sacrifice saved lives,” the chief said.

Students lay candles and flowers at the steps of Kennedy Hall on Wednesday to honor the victims of the shooting. Photograph: Logan Cyrus/AFP/Getty Images

Howell was with classmates for end-of-year presentations in an anthropology class when the shooting happened.

In a statement, UNC-Charlotte said all the victims were students, five from North Carolina and one international. Howell, of Waynesville, and Ellis R Parlier, 19 of Midland, were killed. Those wounded were Sean Dehart, 20, and Drew Pescaro, 19, both of Apex; Emily Houpt, 23, of Charlotte; and Rami Alramadhan, 20, of Saihat, Saudi Arabia.

Terrell, 22, was charged with two counts of murder, four counts of attempted murder and other charges.

The motive wasn’t clear. Terrell had been enrolled at the school but withdrew this semester, UNC-Charlotte spokeswoman Buffy Stephens said. Campus police chief Jeff Baker said Terrell had not appeared on their radar as a potential threat.

“I just went into a classroom and shot the guys,” Terrell told reporters on Tuesday as officers led him handcuffed into a law enforcement building.

Terrell is under observation in police custody, and his father and attorney haven’t been allowed to speak to him, said Paul Rold, his grandfather.

Rold said from his home in Arlington, Texas that Terrell is on the autism spectrum, is “clever as can be” and learned foreign languages. He said his grandson isn’t very social.

At Wednesday night’s campus vigil, student body president Chandler Crean wiped away tears as the school chancellor said they couldn’t emerge unchanged from Tuesday’s shooting, but they could emerge stronger. He later said the university needs to use the shock of what happened to make the world better.

Riley Howell, in a 23 May 2017 photo provided by Matthew Westmoreland. Photograph: Matthew Westmoreland/AP

“What happened yesterday cannot happen again,” Crean said.

The father of Howell’s longtime girlfriend said news that he tackled the shooter wasn’t surprising. Kevin Westmoreland, whose daughter Lauren dated Howell for nearly six years, said Howell was athletic and compassionate and would have been a good firefighter or paramedic.

“If Lauren was with Riley, he would step in front of a train for her if he had to,” Westmoreland said. “I didn’t realize it might come to that for somebody else.”

