Judging by the White House statement after a federal judge struck down California's Proposition 8 on Wednesday, you might think President Obama supports the rights of gays to marry.

The president "has spoken out in opposition to Proposition 8 because it is divisive and discriminatory. He will continue to promote equality for LGBT Americans," the White House said.

(Post User Poll: Do you agree with the decision?)

But Obama does not endorse gay marriage. As a candidate for president, he consistently said marriage should be reserved for a man and a woman.

"I believe that marriage is between a man and woman and I am not in favor of gay marriage," the candidate said just days before the election in 2008.

(VIDEO: Hundreds rally in support of ruling)

So maybe Obama supports the 1996 federal Defense of Marriage Act, which codified a federal ban on gay marriage and is one of the key targets for repeal by the gay community?

Wrong again.

After initially saying the law should not be repealed, Obama switched his position in 2004, calling the law "abhorrent" and calling for its reversal.

(Religious responses to the Prop 8 decision)

"When Members of Congress passed DOMA, they were not interested in strengthening family values or protecting civil liberties," Obama wrote in a letter to a gay-oriented Chicago newspaper. "They were only interested in perpetuating division and affirming a wedge issue."

In 2007, he explained his change of heart as the result of conversations with gay friends, who explained how hurtful the legislation was. Obama repeated his desire to repeal the act as a presidential candidate. But the president has not actively sought an appeal. He has said he would support such an effort by Congress but has accepted the sentiment among congressional leaders that, in the current political environment, a repeal would not pass.