SUNRISE, Florida — Graduating seniors at the Florida high school where a gunman killed 17 people in February received diplomas Sunday and heard from surprise commencement speaker Jimmy Fallon, who urged them to move forward and "don't let anything stop you."

Four families received diplomas on behalf of loved ones who were killed in the attack, which gave rise to a campaign by teens for gun control. Principal Ty Thompson underscored the honors for the dead students in a tweet.

"Remember those not with us, and celebrate all the successes the Class of 2018 has brought to the community and the world!" Thompson tweeted.

Fallon, host of NBC's The "Tonight Show," offered similar praise, saying: "You are not just the future — you are the present. Keep changing the world. Keep making us proud."

In his address, Fallon joked that the students "won't be classmates anymore. You'll be adults who will Facebook search each other at 2 in the morning for the next 10 years."

Turning more serious, he said: "First thing is this: When something feels hard, remember that it gets better. Choose to move forward. Don't let anything stop you." He thanked them for their bravery and activism.

Graduate Shannon Recor said afterward that Fallon "made us laugh and cry."

"He brought a positive energy — I'm glad he came," Recor said.

Congratulations Marjory Stoneman Douglas Class of 2018! You are not just the future - you are the present. Keep changing the world. Keep making us proud. #MSDStrong #YouAreThePresent pic.twitter.com/czvZwezKSt — jimmy fallon (@jimmyfallon) June 3, 2018

The private ceremony for the nearly 800 members of the Marjory Stoneman Douglas High School class of 2018 was held at the BB&T Center, where the National Hockey League's Florida Panthers play. It was moved to the arena to accommodate the expected large crowd. Reporters weren't permitted inside the arena.

Fourteen students and three staff members died in the attack in Parkland on Feb. 14. A former student Nikolas Cruz, 19, is charged with their deaths and with wounding 17 other people. Attorneys for Cruz have said he would plead guilty in exchange for a sentence of life without parole. Prosecutors are seeking the death penalty.

The school planned to present diplomas to the families of Nicholas Dworet, Joaquin Oliver, Meadow Pollack and Carmen Schentrup.

Graduate Chris Grady said the families of the four slain classmates getting standing ovations when they picked up the diplomas, with Oliver's mom wearing a T-shirt that read, "This should be my son."

He said graduates Emma Gonzalez and David Hogg, who have become prominent in the "March for Our Lives" gun control movement, got a mixed response as their names were announced. Gonzalez got cheers, he said, while Hogg got a mixture of cheers and boos.

"I felt bad for him, Grady said. Otherwise, he said, "it was a normal graduation" other than Fallon's speech — "That was cool."

Pollack's brother, boyfriend and cousins were to accept her diploma. Her brother, Hunter Pollack, aired his feelings on Twitter.

"This is a sad day, as I will be walking stage to get her diploma for her," he said.

Today, Is the day my sister has been waiting for. Graduation where she would’ve been getting her diploma and be on her way to attend college. This is a sad day, as I will be walking stage to get her diploma for her. — Hunter Pollack (@PollackHunter) June 3, 2018

Her father, Andrew Pollack, said he was too emotionally spent to attend the ceremony. He has been an outspoken critic of school and law enforcement officials, saying they failed to protect his daughter and the others, but that's not why he stayed away.

"It has nothing to do with them," Pollack told The Associated Press by phone Sunday. "I've just been dead inside since Feb. 14."

Instead, he was headed to central Florida, where this week he will address the armed guards one district has hired for its schools.

As families arrived for the ceremony, gunshots from a nearby public shooting range could be heard echoing over the parking lot.