Secretary of State John Kerry stands for the national anthem during Northeastern University's commencement ceremonies in Boston, Friday, May 6, 2016. Kerry delivered the keynote address during which he told the graduating class that their diversity makes them "Donald Trump's worst nightmare." (AP Photo/Michael Dwyer)
Secretary of State John Kerry stands for the national anthem during Northeastern University's commencement ceremonies in Boston, Friday, May 6, 2016. Kerry delivered the keynote address during which he told the graduating class that their diversity makes them "Donald Trump's worst nightmare." (AP Photo/Michael Dwyer) Credit: Michael Dwyer

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

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 told the graduates. “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 people with 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 also has proposed banning Muslims from entering the U.S.

A Department of State spokesman said Kerry’s comment about Trump was only a joke intended to lighten up the audience. But Kerry, later in his speech, appeared to take another shot at Trump 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 told graduates it’s up to them to halt the spread of violent extremism among the world’s youth. He assured graduates the United States and its allies are winning the battle against extremists in Iraq and Syria. But he added 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 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, he 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 said the global agreement on climate change reached in Paris last year is only the start of the solution.

He ended on an optimistic note, paraphrasing former South African President Nelson Mandela.

“All the hardest jobs,” he said, “seem impossible until they are done.”