U.S. Secretary of State John Kerry told college graduates on Friday that their diversity is "Donald Trump's worst nightmare" and that it's their job to confront global issues ranging from terrorism to climate change.

Secretary of State John Kerry stands for the national anthem during Northeastern University's commencement ceremonies in Boston, Friday, May 6, 2016. (AP Photo/Michael Dwyer)

Speaking to an estimated audience of 25,000 at Northeastern University's commencement, Kerry drew loud applause when he noted the many races and religions among the graduates, and then directed a jab at the presumptive Republican presidential nominee.

"You really do look spectacular," Kerry said. "I want you to just look around you. Classmates from every race, religion, gender, shape, size. Eighty-five countries represented and dozens of languages spoken. You are the most diverse class in Northeastern's history. 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 U.S.-Mexico border and wants to deport the millions of people in the U.S. illegally. He has also proposed banning Muslims from entering the U.S.

Kerry appeared to take another shot at Trump minutes later without calling him out by name.

"We will never come out on top if we accept advice from soundbite salesmen and carnival barkers who pretend the most powerful country on earth can remain great by looking inward and hiding behind walls," Kerry said, again drawing applause.

The Democratic secretary of state later called on graduates to stop the spread of violent extremism among the world's youth. He assured graduates that the United States and its allies are winning the battle against extremists in Iraq and Syria. But he added that the U.S. won't be successful in the long run if the world continues to turn away from other problems that fuel the production of terrorists at what he said is an "alarming" rate.

"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."

During his speech at Boston's TD Garden, Kerry praised the work of President Barack Obama's administration on climate change and public health, but he called on graduates to go further.

He blasted climate change deniers and called the issue "one of the greatest challenges of our time." He added that the global agreement on climate change reached in Paris last year is only the start of the solution.

"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 U.S. 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.

Talking for a half-hour, Kerry described a world filled with heavy challenges. He drew on the spread of the Zika virus, the wide gap between rich and poor, and the 2013 Boston Marathon bombings.

"Boston and Northeastern need no lesson in how important it is to win the battle against terrorists," he said. "There can be no peace without eliminating this scourge."

But he added that the graduates have the education and character to confront those challenges, and he urged them to play a role in the global community. He ended on an optimistic note, paraphrasing former South African President Nelson Mandela.

"All the hardest jobs seem impossible until they are done," Kerry said.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)


Sign up for the NJ1015.com Newsletter

Get the best of NJ1015.com delivered to your inbox every day.