Correction: An earlier version of this article incorrectly said that this was the first time the event was held off campus. Rather, it was the first time it was held at the University of Maryland-College Park. This version has been corrected.

Michelle Obama encouraged the graduates of Bowie State University on Friday to live up to the legacy of their university’s founders and the leaders of the civil rights movement by promoting the importance of education in the black community.

“Just think about this for a moment — for generations, in many parts of this country, it was illegal for black people to get an education,” Obama told the predominantly black crowd, referring to the period in which Bowie State was founded. “Slaves caught reading or writing could be beaten within an inch of their lives.”

The creation in 1865 of the small school that eventually became Bowie State University was an “eloquent act of defiance,” she told the 600 graduates and several thousand of their supporters at the Comcast Center in College Park.

Obama challenged the students to keep a hunger to learn; she quoted abolitionist Frederick Douglass, who said education “means the uplifting of the soul of man into the glorious light of truth, the light by which men can only be made free.”

She received thunderous applause from the intensely friendly and excited crowd, which issued shouts of congratulations to individual graduates along with calls of “Go ’head, ’Chelle! We love you!” and a standing ovation that began before the first lady spoke a word.

In the second of three commencement addresses Obama will give this month, she also called on the graduates to push other African Americans to pursue higher education.

Unlike their ancestors, she said, young African Americans too often “can’t be bothered.”

“Instead of walking miles every day to school, they’re sitting on couches for hours playing video games, watching TV. Instead of dreaming of being a teacher or a lawyer or a business leader, they’re fantasizing about being a baller or a rapper,” she said.

“Please reject the slander that says a black child with a book is trying to act white,” Obama said. “In short, be an example of excellence for the next generation.”

Obama’s 21-minute address did not mention the political or policy issues that are at the forefront of her husband’s administration. She stuck to the historical arc of African Americans in the nation and the need to increase the number who graduate from high school and college. She included a clear challenge to black Americans on issues of personal responsibility, carrying through on a theme that the Obamas have often returned to before black audiences — identifying with the challenges of the community while calling on families and communities to step up and hearkening back to the gains of the civil rights era.

She layered that tough-love cultural commentary — which has sometimes proved controversial for her husband — with statistics, saying that one in three African American students drop out of high school and that only one in five African Americans between the ages of 25 and 29 have a college degree. Most minorities are lagging, according to a study released Friday by the American Council on Education, which found that three out of four students who completed a bachelor’s degree in 2007-08 were white.

The crowd in Maryland seemed to love her message, saying later that the first lady said what needed to be said. Pamela Gaskins, who came to see her goddaughter graduate, said she identified with the story Obama told about her parents’ struggle to pay their share of her college tuition.

“I’m going through that as a single mother, and it’s very hard,” said Gaskins, who purchased a $5 poster of the first lady from a vendor after the ceremony.

Gaskins’s 20-year-old daughter, Kiché Weaver, who just completed her third year at Virginia Union University, said it was Obama’s comment about ballers and rappers that struck her.

“I know people like that, and they want to become rappers just like she said. Hopefully, a lot of people [who] are not enrolled in college heard her,” Weaver said.

Bowie State awarded Michelle Obama, a graduate of Harvard Law School, an honorary doctorate of laws. It also recognized Valerie Simpson and her late husband, Nickolas Ashford, who made up the songwriting team known as Ashford & Simpson, giving Simpson an honorary doctorate of humane letters.

President Obama has spoken at Bowie State twice, including once as a candidate, according to university spokeswoman Damita Chambers. But Friday was the first time a sitting first lady had given a commencement speech for the university.

The occasion also was the first time Bowie State had held its graduation ceremony at the University of Maryland-College Park.. Some of the school’s alumni had argued against the move to the Comcast Center, on the campus of the University of Maryland in College Park, because of the historical relationship between the universities, the school’s student newspaper reported. Black students were once barred from the state’s flagship institution.

The president and first lady have spoken at several historically black colleges and universities during their time in the White House. Michelle Obama has delivered commencement speeches at the University of Arkansas at Pine Bluff, Spelman College and North Carolina A&T. Her husband will speak at Morehouse College’s graduation Sunday.