President Obama has told young African leaders that homophobia comes from the same mindset as racism, and that they should be more accepting of gay people.

Speaking at the Omni Shoreham Hotel in Washington DC, at a three-day summit for the Young African Leaders Initiative, Obama made the comments.

One question came from a participant who said she was from Kenya, and that people with albinism were being killed in order to harvest their body parts for rituals, reports the Washington Blade.

“The same, by the way, is true for sexual orientation,” Obama said, condemning the killing of people with albinism.

“I spoke about this in Africa, and everybody is like, oh, oh, we don’t want to hear that. But the truth of the matter is, is that if you’re treating people differently just because of who they love and who they are, then there’s a connection between that mindset and the mindset that led to racism, and the mindset that leads to ethnic conflict. It means that you’re not able to see somebody else as a human being.”

The President went on to compare the oppression of black people in Africa due to European Imperialism to the way LGBT people are oppressed in some countries, saying: “You can’t, on the one hand, complain when somebody else does that to you, and then you’re doing it to somebody else.”

“You can’t do it,” Obama went on. “There’s got to be some consistency to how you think about these issues. And that’s going to be up to young people — because old people get stuck in their ways.”

A rainbow appeared in Ethiopia last month ahead of a visit from US President Barack Obama – who is expected to raise the country’s anti-gay law with leaders.

During an interview with the BBC’s John Sopel prior to his visit Africa, President Obama said he would be “very blunt” about the need for equality in the country.

He did not disappoint during his visit to Kenya – publicly challenging Kenyan President Uhuru Kenyatta over state discrimination against gay people.