A gunman killed two people when he opened fire on Tuesday at the University of North Carolina at Charlotte. One of those he allegedly murdered has been described by police as a "hero" because of what unfolded in his final moments.

Riley Howell, a 21-year-old from Waynesville, was most likely the last fatality in the school shooting, Charlotte-Mecklenburg Police Chief Kerr Putney told reporters on Wednesday.

UNC CHARLOTTE SHOOTING VICTIMS IDENTIFIED, AS SUSPECT SEEN SMIRKING WHILE IN CUSTODY

The alleged gunman, identified as Trystan Andrew Terrell, 22, encountered Howell in a building on campus, that police said Terrell chose for a reason, with a legally purchased handgun.

Putney said that Howell "did exactly what we train people to do."

"You're either gonna run, gonna hide and shield, or you're gonna take the fight to the assailant," the police chief said. "Having no place to run and hide, he did the last."

It would be an "understatement" to say Howell tackled the gunman, but it "would be appropriate," according to Putney. He said that if Howell didn't approach the gunman, he "might not have been disarmed."

"Unfortunately, he gave his life in the process. But his sacrifice saved lives," he said of Howell. "What he did was he took the assailant off his feet, and then the heroes that we have here were able to apprehend him from there."

Putney described Howell as "the first and foremost hero as far as [he's] concerned" regarding the shooting, which also killed 19-year-old Ellis Parlier.

CLICK HERE TO GET THE FOX NEWS APP

Four students, identified as Drew Pescaro, 19; Sean Dehart, 20; Rami Alramadhan, 20; and Emily Houpt, 23, were injured in the attack.

Terrell was charged early Wednesday with two counts of murder, four counts of attempted murder, four counts of assault with a deadly weapon with intent to kill, possession of a firearm on educational property and discharging a firearm.

Fox News' Travis Fedschun contributed to this report.