Obama lectures Kenyan president on gay rights

Updated 1:39 PM EDT, Sat July 25, 2015
U.S. President Barack Obama and Kenyan President Uhuru Kenyatta inspect an honor guard on July 25, 2015 at the State House in Nairobi.
PHOTO: SIMON MAINA/AFP/Getty Images
U.S. President Barack Obama and Kenyan President Uhuru Kenyatta inspect an honor guard on July 25, 2015 at the State House in Nairobi.
Now playing
01:43
Obama, Kenyatta, make stances on gay rights clear
PHOTO: KTVK
Now playing
01:03
Anti-gay pastor banned from entering South Africa
PHOTO: FILIPPO MONTEFORTE/AFP/Getty Images
Now playing
01:19
Pope Francis: Apologize to gay people and others
PHOTO: AFP/Getty Images
Now playing
02:30
Thousands of gay men pardoned
gay marriage australia pkg lu stout_00021804.jpg
gay marriage australia pkg lu stout_00021804.jpg
Now playing
02:58
Australia's Labor Party against marriage referendum
Now playing
04:27
Afghan gay rights activist: 'Minority within a minority'
gay nightclub attacks dnt kaye ac_00005605.jpg
gay nightclub attacks dnt kaye ac_00005605.jpg
Now playing
03:00
A history of attacks on gay nightclubs
miss Missouri gay America pageant intv banfield lv_00000607.jpg
miss Missouri gay America pageant intv banfield lv_00000607.jpg
Now playing
01:44
First openly gay Miss America contestant speaks out
lbgt group st patricks day parade new york sot_00001606.jpg
PHOTO: WABC
lbgt group st patricks day parade new york sot_00001606.jpg
Now playing
00:53
NYC Mayor: This parade says the city is whole, unified
Judge recinds order lesbian foster parents adoption lv_00000000.jpg
PHOTO: Family Photo
Judge recinds order lesbian foster parents adoption lv_00000000.jpg
Now playing
00:48
Judge rescinds order in same-sex adoption
same sex kissing arrest sidner pkg_00000128.jpg
same sex kissing arrest sidner pkg_00000128.jpg
Now playing
03:16
Same-sex couple: We were arrested for kissing
Republican presidential candidate and Texas senator Ted Cruz speaks during the Iowa Faith and Freedom Coalition annual banquet and presidential forum  Monday June 22, 2015 in Des Moines, Iowa.
(Taylor Glascock for CNN)
PHOTO: Taylor Glascock for CNN
Republican presidential candidate and Texas senator Ted Cruz speaks during the Iowa Faith and Freedom Coalition annual banquet and presidential forum Monday June 22, 2015 in Des Moines, Iowa. (Taylor Glascock for CNN)
Now playing
01:18
Ted Cruz discusses religious liberty
Pope Francis meets hugs same sex couple_00000803.jpg
PHOTO: Marisa Marchitelli
Pope Francis meets hugs same sex couple_00000803.jpg
Now playing
00:48
Pope Francis meets with, hugs same-sex couple
Mike Huckabee Supreme Court debate newday_00000000.jpg
Mike Huckabee Supreme Court debate newday_00000000.jpg
Now playing
02:50
Huckabee doubles down on Supreme Court comments
PHOTO: CNN
Now playing
02:02
Lawyer: Kim Davis met with Pope Francis
Kim Davis released jail_00001502.jpg
Kim Davis released jail_00001502.jpg
Now playing
01:12
Kim Davis and the fight over same-sex marriage

Story highlights

Obama equated legalized discrimination of gays to legalized racism in America

Under Kenyan law, sexual activity between men is illegal and punishable with a maximum imprisonment of 14 years

(CNN) —  

President Barack Obama on Saturday lectured Kenyan President Uhuru Kenyatta about his country’s gay rights record.

“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 said at a joint press conference with the Kenyan leader in Nairobi. “And bad things happen.”

Under Kenyan law, sexual activity between men is illegal and punishable with a maximum imprisonment of 14 years. Many Kenyan leaders had encouraged Obama not to discuss gay rights on his first trip to the country as President.

But Obama equated legalized discrimination of gays to legalized racism in America.

“And when a government gets in a habit of people treating people differently, those habits can spread,” Obama continued. “As an African-American, I am painfully aware of what happens when people are treated differently under the law.”

Kenyatta, however, said that while the U.S. and Kenya share many common values and goals, gay rights is not one of them.

RELATED: For Obama, historic return to Kenya comes after long wait

“The fact of the matter is Kenya and the U.S. share so many values: common love for democracy, entrepreneurship, value for families – these are some things that we share,” Kenyatta said. “But there are some things that we must admit we don’t share. Our culture, our societies don’t accept.”

“It is very difficult for us to be able to impose on people that which they themselves do not accept,” Kenyatta continued. “This is why I repeatedly say for Kenyans today the (gay rights issue) is generally a non-issue. We want to focus on other areas.”

After that comment, a small amount of applause was heard, presumably from some of the audience attending.

Obama and Kenyatta addressed several other topics as well, including Kenya’s economy, their shared fight against terror in the region and Obama’s personal connection to Kenya, the country of his father’s birth.

Obama highlighted Kenya’s improving economy and increased focus on economic development. He announced that the two countries were expanding economic partnerships, including one that would make it easier for businesses to collaborate.

He also said that counterterrorism efforts between the U.S., Kenya and other African countries have greatly reduced the territory controlled by Islamic terrorist group al Shababb.

Obama, who last visited Kenya as a U.S. senator in 2006, apologized for not visiting the nation sooner as President, but said he plans to return after leaving the White House.

“Given the demands of the job and the bubble, I can’t come here and just go upcountry and visit for a week and meet everybody,” he said. “And that’s partly what I had to explain, begging for forgiveness that once I’m a private citizen, I’ll have more freedom to reconnect.”

The President added that when he returns to Kenya, he wants to work on issues affecting the poor.

“I’m more restricted, ironically, as President of the United States than I will be as a private citizen in terms of some of the hands-on direct help I want to do, partly because of schedule and partly because of making sure that in my relationship to Kenya, I’m understood to be operating as the President of the United States,” he said.

Obama and Kenyatta’s connection goes beyond their leadership of their respective nations.

Obama’s father, Barack Obama Sr., feuded with Kenyatta’s father, Kenyan President Jomo Kenyatta, back when the latter was Kenya’s president in the mid-1960s. According to Obama’s 1995 memoir, “Dreams from My Father,” Barack Obama Sr., working as an economist in Kenya’s Ministry of Tourism, criticized the Kenyan government’s corruption and abuse of power, leading Jomo Kenyatta to fire him.