President Barack Obama, left, talks with Senegalese President Macky Sall during a bilateral press conference in Dakar on Thursday.

DAKAR, Senegal — President Barack Obama hailed Wednesday’s Supreme Court rulings on gay marriage, but said he has asked White House lawyers to help determine the implications of the rulings, particularly for states that do not recognize same-sex unions.

Speaking in Senegal, a West African country that criminalizes homosexuality, the president said he believes in basic fairness and said that the court decisions marked a “proud day” for America.

The court struck down the federal Defense of Marriage Act, extending many federal benefits to couples in states where same-sex marriages are permitted, and let stand a ruling that found unconstitutional a California ballot initiative ending gay marriages.

Mr. Obama called the rulings bolstering same-sex marriage a victory for U.S. democracy.

Mr. Obama said the court’s action affirmed principles of equality under the law, and was “one more step toward ensuring these basic principles apply to everybody.”

At the same time, he called the Supreme Court ruling earlier this week striking down a portion of the civil rights-era Voting Rights Act a “mistake.”

Mr. Obama noted the Supreme Court decision on DOMA was “not a blanket ruling” and that it mainly pertained to federal benefits for same-sex partners in the 12 states that already recognize same-sex marriages. A gap occurs in states that do not recognize same-sex unions but where gay couples were married elsewhere, he said.

“We now have to comb through every federal statute,” Mr. Obama said, to determine the legal and administrative ramifications.

“It’s my personal belief … that if you’ve been married in Massachusetts and you move somewhere else, you’re still married and that, under federal law, you should be able to obtain benefits like any lawfully married couple,” he said, but added that he was voicing that view “as a president, not a lawyer.”

His comments came on the opening day of a weeklong visit to Africa. Mr. Obama met Thursday morning with Senegal’s president, Macky Sall, but he said the two did not discuss the prospect of decriminalizing homosexuality in this African country.

After the private meeting, though, Mr. Obama said at a joint press conference: “I want the African people to hear what I believe.”

He then said that while respect should be given to a diversity of views, people should be treated equally under the law and by states.

“I don’t believe in discrimination of any sort,” he said.

Mr. Sall said his is a tolerant country that does not discriminate. But Senegal is not ready to decriminalize homosexuality, he said.

About Washington Wire

Washington Wire is one of the oldest standing features in American journalism. Since the Wire launched on Sept. 20, 1940, the Journal has offered readers an informal look at the capital. Now online, the Wire provides a succession of glimpses at what’s happening behind hot stories and warnings of what to watch for in the days ahead. The Wire is led by Reid J. Epstein, with contributions from the rest of the bureau. Washington Wire now also includes Think Tank, our home for outside analysis from policy and political thinkers.