* Many African nations outlaw homosexuality
* Gay discrimination erodes freedom, Obama says
* U.S. Supreme Court approved same sex marriage in June
By Edith Honan and Jeff Mason
NAIROBI, July 25 (Reuters) - U.S. President Barack Obama told Africans on Saturday that discriminating against gays was like treating people differently because of race, drawing criticism from anti-gay activists who said he was imposing his morality on the continent.
The comments in Kenya by Obama, whose father was Kenyan and who Africans claim as their son, exposed the divide on gay rights between Western states and religiously conservative Africa where many states ban homosexual relations.
“As an African American in the United States I am painfully aware of what happens when people are treated differently,” Obama told a news conference in Nairobi during his first trip as president to his father’s homeland.
Standing next to Kenyan President Uhuru Kenyatta, Obama said his message across Africa was the same: “When you start treating people differently, not because of any harm they are doing to anybody but because they are different, that’s the path whereby freedoms begin to erode.”
Obama, who has shown increasing support for gay rights during his presidency, hailed last month’s U.S. Supreme Court decision to allow same-sex marriage in the United States.
Kenyan Deputy President William Ruto, who attended talks with Obama, had said in May there was “no room” for gays in Kenya, where homosexual relations are outlawed.
Anti-gay laws often have broad public approval in African nations where many hold conservative religious views and see homosexuality as immoral.
“He is connecting himself to Africa but he is offending the values of Africa,” said Kidaha Vincent, who heads Kenya’s fringe Republican Liberty Party.
In response to the same question, Kenyatta said the United States and Kenya shared many values but not in all areas, saying gay rights was a “non-issue” for Kenyans.
“There are some things that we must admit we don’t share - our culture, our societies don’t accept,” Kenyatta said, drawing scattered applause after speaking.
Eric Gitari, who heads a Kenyan gay rights groups, praised Obama for tackling the matter on the basis of “the dignity of people by speaking about simple human to human interactions.”
U.S. group Human Rights First also issued a statement praising Obama for addressing the issue as one of “equality under the law”.
Some African rights groups had urged Obama to tread cautiously on the issue to avoid inflaming public opinion. South Africa is the only African nation to allow same-sex marriage.
Neighbouring Uganda, which moved to toughen prison sentences against gays in 2014, faced stern Western criticism and a halt in some aid before a court struck down the law. U.S. Secretary State John Kerry had called the code “atrocious”. (Writing by Edmund Blair)