Speaking to an estimated audience of 25,000 at Northeastern University's commencement, Kerry drew heavy applause when he noted the many races and religions among the graduates, and then directed a jab at the presumptive Republican presidential nominee.
"You are the most diverse class in Northeastern's history," he said. "In other words, you are Donald Trump's worst nightmare."
Trump has angered many by comments he has made about Hispanics and Muslims, among other groups. He backs building a wall along the US-Mexico border and wants to deport the millions of people in the US illegally. He has also proposed banning Muslims from entering the US.
"Your mission is to make jobs not just in a few places but many places," he said. "Doing this is not about charity, it's not about giving something for nothing. It's about building our own security and preventing the conflicts of the future."
Also Read
"Last March was the hottest March in recorded history. Last year was the hottest year in recorded history," he said. "The facts are simply staggering."
Kerry, who became secretary of state in 2013, was a longtime US senator from Massachusetts and was a prosecutor in the state. He earned a law degree from Boston College in 1976 after graduating from Yale University. He previously delivered the commencement address at Northeastern in 2000.