02:40 - Source: CNN
Scenes of joy after Supreme Court ruling

Story highlights

NEW: He calls former slave trade post a powerful reminder to keep focus on human rights

Obama calls for decriminalizing homosexuality; Senegalese President Sall says no

He's pushing U.S. investment, addressing development issues, promoting democracy in Africa

Nelson Mandela's legacy will linger "throughout the ages," Obama says

Dakar, Senegal CNN —  

U.S. President Barack Obama arrived in South Africa on Friday for the second leg of a trip overshadowed by the deteriorating health of anti-apartheid icon Nelson Mandela.

Every group of people has a right to its own views, Obama said.

“Regardless of race, regardless of religion, regardless of gender, regardless of sexual orientation … people should be treated equally, and that’s a principle that I think applies universally,” Obama said.

The remarks came in response to a question from CNN’s Jessica Yellin on whether Obama was pressing his Senegalese counterpart on the issue. Homosexuality is illegal in Senegal.

Obama said that the issue did not come up in their talks, but that the question of how gays and lesbians are treated has been coming up in Africa in general.

Sall responded that his country has no plans to decriminalize homosexuality.

“Senegal is a very tolerant country which does not discriminate in terms of inalienable rights of human beings,” Senegalese President Macky Sall said. “People are not refused jobs for being gay,” he said. “But we are still not ready to decriminalize homosexuality.”

“But of course this does not mean that we are all homophobic,” Sall insisted.

Sall then turned to another issue on which the two nations differ: capital punishment.

“In our country, we have abolished it for many years,” he said, adding, “We do respect the choice of each country.”

Obama’s Africa visit

Obama left the United States on Wednesday for a trip to Senegal, South Africa and Tanzania – his second visit to sub-Saharan Africa since taking office.

The trip aims to bolster investment opportunities for U.S. businesses, address development issues such as food security and health, and promote democracy. It comes as China aggressively engages the continent. The Asian nation is pouring billions of dollars into Africa, running oil and mining firms, and in 2009 replaced the United States as the largest trading partner.

At Thursday’s news conference, Obama was asked to assess the big news at home: the Supreme Court ruling Wednesday striking down a key part of the Defense of Marriage Act.

The decision was “not simply a victory for the LGBT community,” he said, referring to lesbian, gay, bisexual and transgender people. “I think it was a victory for American democracy.”

READ: Same-sex marriage rulings hailed as historic victory

“I believe at the root of who we are as a people, as Americans, is the basic precept that we are all equal under the law. We believe in basic fairness. And what I think yesterday’s ruling signifies is one more step towards ensuring that those basic principles apply to everybody,” Obama said in response to a question from CNN’s Jessica Yellin.

His administration will now have to comb through every federal statute, he said, to ensure that federal benefits “apply to all married couples.”

There are complexities, he noted. Since some states recognize same-sex marriages and others don’t, the government will need to determine whether a same-sex couple remains married under federal law after moving to a state that does not recognize the marriage.

Mandela’s influence

Obama also spoke of ailing former South African President Nelson Mandela, who is in critical condition in a Pretoria hospital.

“My first act of political activism was when I was at Occidental College as a 19-year-old – I got involved in the anti-apartheid movement,” Obama said.

He said he was inspired by what was taking place at the time in South Africa. He had read Mandela’s writings and speeches, and understood “that this was somebody who believed in that basic principle I just talked about – treating people equally – and was willing to sacrifice his life for that belief.”

Mandela “is a personal hero” and “a hero for the world,” Obama said. “And if and when he passes from this place, one thing I think we’ll all know is that his legacy is one that will linger on throughout the ages.”

Obama’s visit to South Africa on Saturday will include a stop at Robben Island, where Mandela spent a majority of his 27 years in prison. The White House schedule does not include a visit with the anti-apartheid icon.

After making his remarks Thursday, Obama visited Goree Island, which once served as a strategic post in the transatlantic slave trade.

He called the trip a “powerful” reminder that “we have to remain vigilant when it comes to the defense of human rights. …This is a testament to when we’re not vigilant in defense of human rights, what can happen.”

“Obviously, for an African-American, an African-American president, to be able to visit this site, I think, gives me even greater motivation in terms of human rights around the world,” Obama said.

READ: After historic court rulings, what’s next for gay rights movement?

READ: Supreme Court got it wrong on gay marriage

In Senegal, Obama also visited Goree Island, which once served as a strategic post in the transatlantic slave trade.

CNN’s Faith Karimi contributed to this report.