California's voter-approved ban on same-sex marriage is unconstitutional, a federal judge in San Francisco has ruled.

Proposition 8, passed by 52% of voters in November 2008, defined marriage as the union of a man and a woman. But after a non-jury trial earlier this year, Chief District Court Judge Vaughn Walker ruled that the initiative violated the equal-protection and due-process clauses of the 14 Amendment of the U.S. Constitution.

After the court announced yesterday that it would issue its ruling today, both sides said they would appeal to the 9th U.S. Circuit Court of Appeals, also in San Francisco, depending on the outcome. Regardless of how the appeals court rules, the case will reach the U.S. Supreme Court next year or 2012.

Two gay men from Burbank and two lesbians from Berkeley challenged the law, which came in response to a May 2008 state Supreme Court that legalized same-sex marriage. In February 2004, San Francisco's new mayor, Gavin Newsom, approved same- sex marriages, and the city issued about 4,0000 marriage licenses before the state Supreme Court halted the weddings in March. Four months later the court voided all the licenses, prompting lawsuits from gay married couples.

The court set up a special site for the case.

Here's background on the battle over same-sex marriage in California.

Update at 4:58 p.m. ET: In his 136-page opinion, Walker ruled that Proposition 8 "both unconstitutionally burdens the exercise of the fundamental right to marry and creates an irrational classification on the basis of sexual orientation," and that the plaintiffs "seek to have the state recognize their committed relationships, and plaintiffs' relationships are consistent with the core of the history, tradition and practice of marriage in the United States."

Ultimately, Walker concluded, Prop. 8 "fails to advance any rational basis in singling out gay men and lesbians for denial of a marriage license. Indeed, the evidence shows Proposition 8 does nothing more than enshrine in the California Constitution the notion that opposite-sex couples are superior to same-sex couples. "

Update at 5:13 p.m. ET: Read the full ruling here. Documents and video used as evidence can be found here.

Update at 5:33 p.m. ET: In a statement, California Attorney General Jerry Brown, who refused to defend Prop. 8 in court, notes that Walker "came to the same conclusion I did when I declined to defend it."

Brown, a Democrat and former governor, is running against Republican Meg Whitman, a founder of eBay, to replace Gov. Arnold Schwarzenegger. Whitman opposes same-sex marriage.

In his response, Schwarzenegger said, "For the hundreds of thousands of Californians in gay and lesbian households who are managing their day-to-day lives, this decision affirms the full legal protections and safeguards I believe everyone deserves. At the same time, it provides an opportunity for all Californians to consider our history of leading the way to the future, and our growing reputation of treating all people and their relationships with equal respect and dignity.

"Today's decision is by no means California's first milestone, nor our last, on America's road to equality and freedom for all people."

Update at 5:55 p.m. ET: Opponents are weighing in, USA TODAY's Donna Leinwand reports.

Brian Brown, president of the National Organization for Marriage, which opposes same-sex marriage, called the judge biased.

"Big surprise! We expected nothing different from Judge Vaugh Walker, after the biased way he conducted this trial," Brown said in a statement. "With a stroke of his pen, Judge Walker has overruled the votes and values of 7 million Californians who voted for marriage as one man and one woman. This ruling, if allowed to stand, threatens not only Prop 8 in California but the laws in 45 other states that define marriage as one man and one woman."

"Here we have an openly gay (according to the San Francisco Chronicle) federal judge substituting his views for those of the American people and of our Founding Fathers who I promise you would be shocked by courts that imagine they have the right to put gay marriage in our Constitution," NOM chairman Maggie Gallagher added in the statement.

On her Faith & Reason blog, USA TODAY's Cathy Lynn Grossman writes that the Mormons, who were perhaps the biggest backers of Prop. 8, were first to respond.

They said, in part, "The Church of Jesus Christ of Latter-day Saints regrets today's decision. California voters have twice been given the opportunity to vote on the definition of marriage in their state and both times have determined that marriage should be recognized as only between a man and a woman. We agree. Marriage between a man and woman is the bedrock of society."

Update at 6:27 p.m. ET: The Los Angeles Times points out that Vaughn temporarily stayed his order until Friday to give Prop. 8 supporters time to file appeals and seek a longer stay. As a result, the Times writes, "The decision would appear to delay any resumption of gay marriage in the state."

(Posted by Michael Winter)