TRENTON -- Donald Trump apparently wasn't a fan of President Obama's commencement speech at Rutgers University.

The presumptive Republican presidential nominee took to Twitter on Monday night to criticize the key line in Obama's address to graduates this weekend:

"In politics, and in life, ignorance is not a virtue." This is a primary reason that President Obama is the worst president in U.S. history! — Donald J. Trump (@realDonaldTrump) May 17, 2016

In Sunday's speech, Obama issued thinly veiled critiques of Trump, the billionaire businessman and former Atlantic City casino tycoon who has dominated the race for the Republican nomination but sparked controversy for comments about illegal immigration and Muslims and for mocking his opponents with insults.

Though he never mentioned Trump by name, the Democratic president decried how "anti-intellectualism" has seeped into American politics.

"If you were listening to today's political debate, you might wonder where this strain of anti-intellectualism came from," Obama told Rutgers' graduating class. "In politics and in life, ignorance is not a virtue."

The president also noted that isolationist policies -- such as Trump's proposals to build a wall across the U.S.-Mexico border and temporarily banning Muslims from America -- run counter to the nation's history as a melting pot.

"That's how we became America," Obama said. "Why would we want to stop it now?"

Trump has been a critic of Obama for years. He was one of the leading figures of the "birther" movement in 2011, suggesting that the president -- who was born in Hawaii and identifies as a Christian -- was not born in the U.S. and is actually a Muslim.

Brent Johnson may be reached at bjohnson@njadvancemedia.com. Follow him on Twitter @johnsb01. Find NJ.com Politics on Facebook.