US President Barack Obama has called on African governments to give gay people equal rights by decriminalising homosexual acts.
Mr Obama made the comments in Senegal after meeting President Macky Sall on the first leg of his African tour.
Mr Sall said Senegal was a "very tolerant" country but it was "not ready to decriminalise homosexuality".
Homosexual acts are still a crime in 38 African countries, where most people hold conservative religious views.
In 2011, the US and UK hinted that they could withdraw aid from countries which did not respect gay rights.
Mr Obama said at a news conference that the issue did not come up in his discussions with Mr Sall.
Nevertheless, he believed that while different customs and religions should be respected, the law should treat everybody equally, he said.
Mr Obama welcomed the US Supreme Court's decision on Wednesday to strike down a law that denied the recognition of same-sex marriages.
The ruling was a "victory for American democracy and a proud day for equal rights", he said
Mr Sall said Senegal was still not ready to change its laws, but that "does not mean we are homophobic''.
This is Mr Obama's third visit to Africa since he became president in 2008.
He is also due to travel to South Africa and Tanzania.
Africa had made "amazing" strides in achieving democracy, Mr Obama said.
Senegal, a mainly Muslim country which has never been hit by a coup, was one of America's "strongest partners" on the continent, he added.
"It's moving in the right direction with reforms to deepen democratic institutions and as more Africans across this continent stand up and demand governments that are accountable and serve the people, I believe Senegal can be a great example," Mr Obama said.
Mr Obama, along with his wife Michelle and children, is due to travel by ferry to Senegal's Goree Island, a memorial to Africans who were caught up in the Atlantic slave trade.
The visit is expected to be emotional because Mr Obama is the son of an African and Michelle Obama is a descendant of slaves, correspondents say.
"A visit like this by an American president, any American president, is powerful," said White House spokesman Jay Carney.
"I think that will be the case when President Obama visits and I'm sure particularly so, given that he is African American."
On Sunday, Mr Obama is expected to visit Robben Island, where South Africa's first black president Nelson Mandela was jailed for 18 of the 27 years he spent in prison, on the second leg of his African tour.
However, it is unclear whether the visit will take place because of Mr Mandela's deteriorating health, correspondents say.
Mr Obama is due to end his African tour with a visit to Tanzania, where he will pay his respects at a memorial outside the US embassy in the main city, Dar es Salaam, in honour of 11 people killed in a bombing by al-Qaeda in 1998.
He has excluded from his itinerary Kenya, where his father was born, and Nigeria, Africa's biggest oil producer which has been hit by an Islamist insurgency.
US officials reportedly said the indictment of Kenyan President Uhuru Kenyatta at the International Criminal Court on charges of fuelling violence after the 2007 election, which he denies, made it politically impossible for Mr Obama to visit the country.