Jimmy Fallon made a surprise visit at Marjory Stoneman Douglas High School's graduation ceremony on Sunday, nearly four months after the students survived a shooting that killed 17 of their classmates and teachers.

In his commencement speech, Fallon offered comic relief and thanked the student activists who have been spearheading gun control reform.

"Today you're graduating from high school," Fallon, host of The Tonight Show, said. "You should feel incredibly proud of yourselves. That doesn't mean you should rest on your laurels — or your yannys."

Yannys and Laurels aside, he continued, "Here's what will matter: You, the class of 2018, will have graduated. And you won't be classmates anymore. You'll be adults who Facebook search each other at two in the morning for the next 10 years."

In simultaneous dig at himself, and a nod to the far-reaching movement inspired by MSD students who showed not all change-makers are adults, Fallon humorously ushered in the occasion as "Opposite Day."

"When you think of commencement speakers, you think of people who are inspirational, people who are eloquent, people who've changed the world," he said. "When you think of high school students, you think of people who are immature, slightly awkward, still learning to be an adult."

In the ceremony's venue, the BB&T Center, home to the Florida Panthers hockey team, Fallon then delivered the graduating seniors some "real-world advice."

"When something feels hard, remember that it gets better. Choose to move forward. Don't let anything stop you," he told the graduates, who wore sashes that read "MSD Strong."

The families of the four seniors who had died in the shooting — Nicholas Dworet, Joaquin Oliver, Meadow Pollack, Carmen Schentrup — accepted diplomas on their behalf.

He mentioned having met some of the students at the "March for Our Lives" protest in Washington, D.C., earlier this year: "It was an amazing day."

"Thank you for your courage and your bravery," he said, "and for giving amazing speeches I could never possibly live up to."

He says he and his wife brought his two young daughters to Sunday's event "because we wanted them to see what hope and light looks like."

The comedian poked fun at what, at first, he saw as a personal setback for his younger self, who he said "wasn't dumb" but "just had other strengths." Obligated to go to summer school, happily, he said, it turned out "I met 15 versions of myself. Everyone was funny — and slightly dumb. I loved summer school!"

In other words, he said, "Some things that seem like setbacks can take our lives in a totally new direction — they change us in ways we don't expect. And they make us better, and stronger."

"You guys have already proven that to everyone," he said. "You took something horrific, and instead of letting it stop you, you started a movement."

"The whole world has heard your voice. And that was you making a choice," he said. "That was you choosing hope over fear."

You can listen to Fallon's full commencement speech below:

Copyright 2018 NPR. To see more, visit http://www.npr.org/.