President Barack Obama on Wednesday congratulated the two gay couples involved in a Supreme Court case which challenged Proposition 8, California's gay marriage ban.

In Hollingsworth v. Perry, the high court dismissed an appeal to a lower court's ruling invalidating the 2008 voter-approved amendment to the California Constitution. The ruling, authored by Chief Justice John Roberts, determined that the Prop 8 petitioners had no standing to appeal.

(Related: Gay plaintiffs triumph at Supreme Court: DOMA struck down, Prop 8 dismissed.)

While appearing on MSNBC, the four plaintiffs – Paul Katami and Jeff Zarillo and Kris Perry and Sandy Stier – received a surprise call from the president.

“We're proud of you guys and we're thrilled to have this … in California,” Obama said.

He added that the four should be proud of what they have achieved.

“Through your courage, you're helping out a whole lot of people,” he said. (The video is embedded on this page. Visit our video library for more videos.)

In a statement, Obama also applauded the Supreme Court's decision striking down the Defense of Marriage Act (DOMA), which prohibited federal agencies from recognizing the legal marriages of gay couples.