'Turning pain to purpose': Biden gives surprise video address to graduating Parkland students

President Joe Biden, in a surprise video address to a Tuesday commencement ceremony, said graduating seniors who were freshmen when a mass shooting left 17 people dead at their Florida high school have turned pain into purpose and darkness into light.

Besides surviving the most deadly high school shooting in U.S. history, Biden also noted that the students graduating this year from Marjory Stoneman Douglas High School in Parkland had their academic careers further disrupted by COVID-19.

The video was recorded in the East Room of the White House and played at the ceremony in South Florida.

"Three years ago, your lives and the lives of this community changed in an instant," Biden told the graduates in the recording. "This class lost a piece of its soul. You’ve been tested in ways no young person should ever have to face – from a freshman year, a year of unspeakable loss, to a junior and senior year upended by a pandemic."

People are brought out of the Marjory Stoneman Douglas High School after a mass shooting at the school on February 14, 2018 in Parkland, Florida.

"The story of this class and the Parkland community isn't just a story of pain. It's a story of resilience, turning pain to purpose, darkness to light," the president continued. "This is the legacy you're building, the legacy you'll continue to build."

Of those killed in the February 2018 shooting, 14 were students and three were staff members. Nine of those students would have graduated with the Class of 2021. Instead, their parents were set to receive their diplomas.

"No graduation class gets to choose the world in which they graduate," Biden said in the video. "But every once in a while, every few generations, young people come along at a point in history with a chance to make real change. The world has already seen just how capable you are, how strong you are, how resilient you are. There's no question you're already changing the world. I'm so proud of each and every one of you. Because of you, I have never been more optimistic about our future than today."

The Associated Press contributed to this report