More than 300 seniors at a Texas high school have received their diplomas with the memory of a deadly mass shooting on campus still fresh in their minds.

The Santa Fe High School seniors gathered at twilight in the 83-degree heat and 76 percent humidity on the artificial-turf football field to become the school's first to graduate since May 18, when two substitute teachers and eight fellow students were killed in a mass shooting. A 17-year-old student identified as the shooter is being held on capital murder charges.

The 328 graduating seniors, wearing white stoles in tribute to those slain, and their well-wishers watched a montage tribute to the slain students and teachers on the stadium's video display board. Speeches by school principal Rachel Blundell, valedictorian Corrigan Garcia and salutatorian Bailee Dobson referred to "the events of May 18."

But Blundell reassured the seniors that surviving such an experience equips them with the strength and courage to cope with the challenges that will come later in life.

"Great leaders and great nations have emerged out of the ashes of some of the greatest tragedies," she said.

Garcia told his classmates that the shared experience only brought them closer and gave them the strength that unity brings. "We've made it through the worst of it," he said in his valedictory speech. But he said that another foe confronted the graduates, the emotions of trauma and loss that could be overwhelming.

"Moving on will be tough. Nothing will ever be the same for any of us. But we all have a choice to make," he said.

"It's been a bit of a wild ride," Dobson said in her speech. "This year has been one of the most bizarre and life-changing years that we've had so far. First we had (Hurricane) Harvey, then we had snow, and most recently we had the tragic events of May 18th that happened in our very school." But she said her classmates had remained strong "through all the challenges that life has thrown at us."

The ceremony came a day after President Donald Trump met privately with families of the victims and others near Houston.