The fatal shooting of an unarmed black teenager by a white police officer in Ferguson, Missouri, has become part of the national conversation on race relations in the U.S. But long before Michael Brown and Darren Wilson’s names became known, the country’s first African-American president has shared his views on America's racial history and the tensions that still exist.   

Below are five important moments where President Barack Obama has spoken on race since he entered the national spotlight.

1. “A More Perfect Union” Speech

Obama’s speech at the National Constitution Center in Philadelphia became a turning point in his campaign to become the nominee for the Democratic Party on March 18, 2008. The 40-minute speech directly addressed comments made by Obama’s pastor in Chicago, the Rev. Jeremiah Wright, who was recorded calling the U.S. government a "racist and arrogant superpower" that has “failed the vast majority of our citizens of African descent." The comments came after several videos of his sermons were leaked to ABC News.

In Obama’s speech, he confirmed he was present when Wright made some of the inflammatory remarks. He said they “expressed a profoundly distorted view of this country -- a view that sees white racism as endemic, and that elevates what is wrong with America above all that we know is right with America." But he also took the time to explain in a nuanced way why many African-Americans feel angry, and to express empathy with white Americans -- like the adored grandmother who helped raise him -- who associate young black men with crime and violence.

2. Obama Tells Black Teens To “Pull Up Their Pants”

In an MTV interview during Obama’s 2008 campaign, he weighed in on sagging-pants ordinances that were being passed at the time. He called the laws “a waste of time,” saying more attention should be given to creating jobs, improving schools and health care.

“Having said that, brothers should pull up their pants,” Obama said. “You are walking by your mother, your grandmother, your underwear is showing. What’s wrong with that? Come on. There are some issues that we face, that you don’t have to pass a law, but that doesn’t mean folks can’t have some sense and some respect for other people and, you know, some people might not want to see your underwear -- I’m one of them.”

3. Obama Sits Down With “Racist” Police Officer At Beer Summit

In 2009, a white police officer arrested black Harvard Professor Henry Louis Gates Jr. after a reported break-in at the professor’s house. (It was Gates himself trying to get into his own Cambridge, Massassachusetts, home.) Sgt. James Crowley, the police officer involved, arrested the professor for disorderly conduct after he reportedly refused to show his identification when asked. Colleagues accused the officer of racial bias and the case was thrust into the national spotlight.

At a news conference days after the incident Obama said the police involved “acted stupidly.” While Obama admitted he may be “little biased” since Gates was a friend, Obama said: “I think it's fair to say, No. 1, any of us would be pretty angry; No. 2, that the Cambridge police acted stupidly in arresting somebody when there was already proof that they were in their own home; and, No. 3 ... that there's a long history in this country of African-Americans and Latinos being stopped by law enforcement disproportionately."

Two weeks later, Obama convened a so-called "beer summit' with the two men involved. The 40-minute chat that took place on the White House’s Rose Garden patio over mugs of beers did not involve apologies but the pair did acknowledge respect for one another.

"We agreed to move forward," Crowley told the Associated Press about the meeting. "I think what you had today was two gentlemen agreeing to disagree on a particular issue. I don't think that we spent too much time dwelling on the past. We spent a lot of time discussing the future."

Ahead of the meeting, Obama called the conversation a "teachable moment," saying, "Hopefully, instead of ginning up anger and hyperbole everybody can just spend a little bit of time with some self-reflection and recognizing that other people have different points of view."

4.  Comments On Trayvon Martin

After the 2012 fatal shooting of an unarmed 17-year-old black teenager in Sanford, Florida, Obama spoke out in unusually personal terms. "If I had a son, he'd look like Trayvon,” he said. "I think [Trayvon's parents] are right to expect that all of us as Americans are going to take this with the seriousness it deserves, and we are going to get to the bottom of exactly what happened."

In 2013, after George Zimmerman, the man who fatally shot Martin, was acquitted, Obama described some of the experiences he has had as a black American.

"There are very few African-American men in this country who have not had the experience of being followed when they are shopping at a department store. That includes me," Obama said.  

"There are probably very few African-American men who have not had the experience of walking across the street and hearing the locks click on the doors of cars. That happened to me -- at least before I was a senator," he added.

“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,” he said.

5. On Ferguson

Speaking days after Michael Brown’s death, Obama was cautious in what he said -- an approach that was criticized.

"I have to be very careful about not prejudging these events before investigations are completed. Because, although these are, you know, issues of local jurisdiction -- you know, the DOJ [Department of Justice] works for me," Obama said Aug, 18. "And then when they're conducting an investigation, I've got to make sure that I don't look like I'm putting my thumb on the scales one way or the other."

A month later, Obama mentioned the unrest in Ferguson during a speech at the United Nations.

“I realize that America’s critics will be quick to point out that at times we too have failed to live up to our ideals; that America has plenty of problems within its own borders.  This is true,” Obama said describing the fatal shooting in Ferguson. “So, yes, we have our own racial and ethnic tensions.  And like every country, we continually wrestle with how to reconcile the vast changes wrought by globalization and greater diversity with the traditions that we hold dear.”