President Obama on Wednesday praised the Supreme Court’s decision to strike down the federal Defense of Marriage Act, calling the nation “better off” in the wake of the historic ruling.

“I applaud the Supreme Court’s decision to strike down the Defense of Marriage Act,” Obama said aboard Air Force One, en route to a weeklong trip in Africa. “This was discrimination enshrined in law. It treated loving, committed gay and lesbian couples as a separate and lesser class of people. The Supreme Court has righted that wrong, and our country is better off for it.”

With the 5-4 decision, the nation’s highest court found that the 1996 Defense of Marriage Act, signed into law by President Bill Clinton, “violates basic due process and equal protection principles applicable to the federal government.”

At the same time, the Supreme Court struck a middle ground between prohibiting gay marriage and allowing same-sex nuptials across the nation. With another 5-4 ruling, the justices said the court lacked the standing to weigh in on the merits of California’s gay marriage ban, Proposition 8.

The president did not respond directly to the ruling on the California law, instead keeping his focus on the Defense of Marriage Act, a federal statute his Justice Department had stopped enforcing.

“This ruling is a victory for couples who have long fought for equal treatment under the law; for children whose parents’ marriages will now be recognized, rightly, as legitimate; for families that, at long last, will get the respect and protection they deserve; and for friends and supporters who have wanted nothing more than to see their loved ones treated fairly and have worked hard to persuade their nation to change for the better,” he said.

Obama has trumpeted a long and gradual personal evolution on the issue of gay marriage.

Ahead of November’s presidential election, Obama came out in favor of same-sex marriage but said such laws should be decided by the states. Earlier this year, however, Obama’s Justice Department argued that California’s Proposition 8 violated the Equal Protection Clause of the Constitution.

Obama’s stance on gay marriage has mirrored shifts in public opinion on the social issue. According to a series of recent polls, a majority of Americans support the concept of same-sex marriage.

“Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law,” the president said in his second inaugural address, leaving himself little wiggle room on the issue.

From Air Force One, Obama also called the plaintiffs in the Defense of Marriage Act case.

“We’re proud of you guys, and we’re proud to have this in California,” Obama said as the gay-rights advocates put the conversation on speakerphone outside the Supreme Court. “And it’s because of your leadership things are heading the right way. So you should be very proud today.”

The timing of Obama’s remarks was somewhat ironic in that he was heading to Senegal, an African nation where homosexuality is outlawed.

And despite the major victory for gay-rights advocates, some are calling on the president to do more. He has yet to call for all states to allow gay marriage, a topic he was careful not to broach early Wednesday.

He also pointed out that the Supreme Court rulings do not change the way religious institutions define marriage.

“On an issue as sensitive as this, knowing that Americans hold a wide range of views based on deeply held beliefs, maintaining our nation’s commitment to religious freedom is also vital,” the president said. “How religious institutions define and consecrate marriage has always been up to those institutions. Nothing about this decision – which applies only to civil marriages – changes that.”