HAMPTON, Va. — For the first time as president, Barack Obama on Sunday delivered a commencement address to a historically black college, Hampton University, telling graduates that they have “a separate responsibility” to become mentors to other young African-Americans to help close a persistent gap in educational achievement.

Mr. Obama, clad in a “Hampton blue” robe, said the 1,072 graduates were better poised to enter an economy still recovering from recession and facing global competition than Americans without a college degree, who have an unemployment rate twice as high as those with one.

“I don’t have to tell you that too many folks back home aren’t as well prepared,” he said. “By any number of different yardsticks, African-Americans are being outperformed by their white classmates, as are Hispanic-Americans. Students in well-off areas are outperforming students in poorer rural or urban communities, no matter what skin color. Globally, it’s not even close.”

Image President Obama delivered remarks at a commencement ceremony at Hampton University in Hampton, Va., on Sunday. Credit... Luke Sharrett/The New York Times

Mr. Obama said all Americans have a responsibility “to change this, to offer every single child in this country an education that will make them competitive in our knowledge economy.” But, he told the graduates, “all of you have a separate responsibility — to be role models for your brothers and sisters, to be mentors in your communities and, when the time comes, to pass that sense of an education’s value down to your children.”