President Obama made a surprise appearance in the White House briefing room Friday to share his thoughts on the acquittal of George Zimmerman in the shooting death of Trayvon Martin, saying it is important to look at the case through the lens of past discrimination.

"Trayvon Martin could have been me 35 years ago," Obama said, during extensive and deeply personal remarks that lasted for 18 minutes. "And when you think about why, in the African American community at least, there’s a lot of pain around what happened here, I think it’s important to recognize that the African American community is looking at this issue through a set of experiences and a history that -- that doesn’t go away."

Obama continued: "And I don't want to exaggerate this, but those sets of experiences inform how the African American community interprets what happened one night in Florida. And it's inescapable for people to bring those experiences to bear."

Obama spoke in a quiet and sometimes halting voice, without notes, touching on both his own experience as a black man and what he sees in his daughters, Sasha and Malia, and their relationship to children of other races. "There are very few African American men who haven't had the experience of being followed in a department store. That includes me," he said.

But he also struck a hopeful note, saying, "As difficult and challenging as this episode has been, things are getting better."

The president said that his daughters and their friends are "better than we are, they’re better than we were, on these issues. And that’s true at every community I’ve visited across this country."

“We should also have confidence that kids these days, I think, have more sense than we did back then, and certainly more than our parents did or our grandparents did," Obama said. "And along this long journey, we’re becoming a more perfect union, not a perfect union, but a more perfect union.”

Obama said he and his deputies were considering a few concrete policy options in the wake of the Zimmerman verdict, such as trying to train state and local law enforcement officials how to better deal with issues of racial bias, and exploring whether state laws such as "Stand Your Ground" might "encourage the kinds of altercations and confrontations" rather than defuse them.

More broadly, he said he wanted to pursue a "long-term project" of "thinking about, how do we bolster and reinforce African American boys? And this is something that Michelle and I talk a lot about. There are a lot of kids out there that need help, that are getting a lot of negative reinforcement."

It is important, Obama said, for individual Americans to "do some soul-searching" about their own inherent racial biases, and ask, "Am I wringing as much bias out of myself as I can?"

"That would, I think, be an important exercise in the wake of this tragedy," he said.

More on this story:

Full video of Obama's remarks

Full transcript

The Fix: President Obama's remarkably personal speech on race

Robert Zimmerman: 'I'm glad he spoke out today'