"Here in America, we don't give into our fears. We don't build up walls to keep people out, because we know that our greatness has always depended on contributions from people who were born elsewhere," Obama said.
See images of Michelle Obama:
Michelle Obama's most fashionable moments
Michelle Obama says US doesn't 'build up walls to keep people out'
WASHINGTON, DC - JANUARY 20: First lady Michelle Obama (2R) waves standing with (L-R) Carolyn Reed of Denver, Colorado, Astrid Muhammad of North Carolina, Anthony Mendez of Bronx, New York and Dr. Jill Biden prior to U.S. President Barack Obama's State of the Union speech before members of Congress of the U.S. Capitol January 20, 2015 in Washington, DC. Obama was expected to lay out a broad agenda including attempts to address income inequality and making it easier for Americans to afford college education and child care. (Photo by Mark Wilson/Getty Images)
Washington, DC - January 24:
First Lady Michelle Obama waves to acknowledge applause as she joins her guests before President Barack Obama addresses a Joint Session of Congress while delivering his State of the Union speech, on January, 24, 2012 in Washington, DC.
(Photo by Bill O'Leary/The Washington Post via Getty Images)
US First Lady Michelle Obama acknowledges applause pruior to US President Barack Obama's State of the Union Address before a joint session of Congress and the Supreme Court on January 25, 2011 on Capitol Hill in Washington, DC. AFP PHOTO / Nicholas KAMM (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
WASHINGTON, DC - DECEMBER 14: (L-R) U.S. President Barack Obama, First Lady Michelle Obama, and Rita Ora speak onstage at TNT Christmas in Washington 2014 at the National Building Museum on December 14, 2014 in Washington, DC. 25248_001_0620.JPG (Photo by Theo Wargo/WireImage)
US first lady Michelle Obama (L) and US President Barack Obama arrive for an event in the East Room of the White House December 7, 2014 in Washington, DC. Obama and the first lady welcomed recipients of the 37th Annual Kennedy Center Honors to the White House to celebrate their contributions to the arts. AFP PHOTO/Brendan SMIALOWSKI (Photo credit should read BRENDAN SMIALOWSKI/AFP/Getty Images)
WASHINGTON, DC - DECEMBER 08: President Barack Obama (R) and First Lady Michelle Obama arrive for a reception at the White House for the 2013 Kennedy Center Honorees on December 8, 2013 in Washington, DC. The honorees this year include: opera singer Martina Arroyo, jazz musician Herbie Hancock, musician Billy Joel, actress Shirley MacLaine and musician Carlos Santana. (Photo by Kristoffer Tripplaar-Pool/Getty Images)
US First Lady Michelle Obama and US President Barack Obama arrive during an event in the East Room of the White House December 2, 2012 in Washington, DC. Obama and US first lady Michelle Obama attended the event at the White House with the 2012 Kennedy Center Honorees before to celebrate their contribution to the arts before heading to the Kennedy Center for the honors program. AFP PHOTO/Brendan SMIALOWSKI (Photo credit should read BRENDAN SMIALOWSKI/AFP/Getty Images)
Washington, DC - December, 4: Guests arrive at the Kennedy Center for tonights honors awards with President Obama in attendance on December, 04, 2011 in Washington, DC. Pictured, First Lady Michelle Obama, right, and President Barack Obama, arrive in the Presidential box and greet the honorees including Yo Yo Ma, second left, and Meryl Streep, left. (Photo by Bill O'Leary/The Washington Post via Getty Images)
US President Barack Obama, First Lady Michelle Obama pose with French President Francois Hollande as he arrives for the State Dinner at the North Portico of the White House on February 11, 2014 in Washington, DC. AFP PHOTO/Mandel NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images)
LOS ANGELES, CA - JULY 16: First Lady Michelle Obama speaks onstage at the The Grammy Museum's Jane Ortner Education Award luncheon at The Grammy Museum on July 16, 2014 in Los Angeles, California. (Photo by Jason LaVeris/FilmMagic)
NEW YORK, NY - JULY 10: First Lady of the United States Michelle Obama onstage at the LULAC/NUVOtv Unity Luncheon With Jennifer Lopez at New York Hilton Midtown on July 10, 2014 in New York City. (Photo by Larry Busacca/Getty Images for NUVOtv)
UNITED STATES - SEPTEMBER 6: From left, first lady Michelle Obama, President Barack Obama, and their daughters Sasha and Malia, wave to the crowd following the President's speech at the Democratic National Convention at Time Warner Cable Arena in Charlotte, N.C., on Thursday, Sept. 6, 2012. (Photo By Bill Clark/CQ Roll Call)
Discover More Like This
BACK TO SLIDE
"Our greatness has always come from people who expect nothing and take nothing for granted, folks who work hard for what they have then reach back and help others after them," she said. "That is your story, graduates. And that is the story of your families. And it's the story of my family, too. As many of you know, I grew up in a working class family in Chicago. And while neither of my parents went past high school, let me tell you, they saved up every penny that my dad earned at his city job because they were determined to send me to college."
In addition to jabbing Trump's aspiration of building a wall between the U.S. and Mexico, the first lady also spoke about the value of diversity more broadly.
Obama's comments on the significance of her own presence at the White House also got some attention.
"It's the story that I witness every single day when I wake up in a house that was built by slaves and I watch my daughters, two beautiful black young women head off to school waving goodbye to their father, the president of the United States."
The speech marked the last commencement speech Obama will have given as the first lady.