US president Barack Obama has taken a swipe at Donald Trump as he urged college graduates to shun those who want to build walls around the United States or embrace ignorance.
Mr Obama used his commencement speech at New Jersey's Rutgers University to illustrate a worldview which counters the ideas espoused by Mr Trump, the presumptive Republican presidential nominee.
Looking out at a sea of red and black gowns, Mr Obama told roughly 12,000 graduating students that the pace of change on the planet is accelerating, not slowing, and that recent history has shown that the toughest challenges cannot be solved in isolation.
"A wall won't stop that," Mr Obama said, bringing to mind Mr Trump's call for a border wall between the US and Mexico.
"The point is, to help ourselves, we've got to help others - not pull up the drawbridge and try to keep the world out."
The US president did not mention Donald Trump by name, but his intended target seemed clear.
Repeatedly, Mr Obama referred to disparaging comments about Muslims and immigrants, and opposition to free trade deals.
But he appeared most incensed by what he described as a rejection of facts, science and intellectualism, which he said was pervading politics.
"In politics and in life, ignorance is not a virtue," Mr Obama said.
"It's not cool to not know what you're talking about. That's not 'keeping it real' or 'telling it like it is'. That's not challenging political correctness. That's just not knowing what you're talking about.
"And yet, we've become confused about this," he continued, warning that the rejection of facts and science would lead the US on a path of decline.
Some 50,000 students and their families packed High Point Solution Stadium for the ceremony, the first at Rutgers to involve a sitting president.
The public university's leaders lobbied the president for years to come to campus for the school's 250th anniversary, and Mr Obama praised the school for its diverse student body and research programmes.
The address was the second of three commencement speeches which Mr Obama will deliver during his final graduation season as president.
Earlier in May, the president told graduates at historically black Howard University that the country is "a better place today" than when he graduated from Columbia University more than 30 years ago.
The president will also speak on June 2 at the US Air Force Academy in Colorado Springs, Colorado.
The university also bestowed an honorary law degree on the president, adding to the half-dozen or so other honorary degrees that Columbia University and Harvard Law School graduate Mr Obama has received.