Obama directed attorney general Eric Holder to review all relevant federal laws to ensure the ruling is implemented.
"We are a people who declared that we are all created equal, and the love we commit to one another must be equal as well," Obama said in a written statement.
He got the news as he flew to Africa aboard Air Force One.
Obama said the ruling applies only to civil marriages and that how religious institutions define and consecrate marriages has always been up to those institutions.
"The laws of our land are catching up to the fundamental truth that millions of Americans hold in our hearts: when all Americans are treated as equal, no matter who they are or whom they love, we are all more free," he concluded in his statement.
Meanwhile, defenders of California's gay marriage ban, known as Proposition 8, said on Wednesday that they would seek continued enforcement of the ban until a statewide order is issued.
Pugno said the Supreme Court did "not directly resolve questions about the scope" of that lower court order. – Reuters