A federal judge in California ruled Wednesday that the state's ban on same-sex marriage violates the constitutional right to equal protection. The decision is the first step in a legal struggle that is widely expected to end at the Supreme Court.

In the nation's first federal trial on same-sex marriage, Judge Vaughn R. Walker said that California's Proposition 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," wrote Walker, chief judge of the U.S. District Court for the Northern District of California in San Francisco. In 2008, 52 percent of the state's voters approved Proposition 8, an amendment to the state Constitution.

(Read Judge Vaughn's full ruling)

The decision set off joyous celebrations in California and elsewhere, outrage among conservative activists and a solemn determination among those opposed to same-sex marriage to appeal the decision to the nation's highest court. Walker said opponents have until Friday to convince him that the decision should be stayed during the appeals process, or the marriages will resume. About 18,000 same-sex couples in California married in the five-month period between the time the state Supreme Court allowed such unions and the voter initiative curtailed them.

(Post poll: Do you agree with the decision?)

The U.S. Supreme Court has never directly addressed the question of same-sex marriage, and most think that the case is headed there after it is appealed to the U.S. Court of Appeals for the 9th Circuit.

Walker, a veteran judge who was first nominated by President Ronald Reagan and confirmed under President George H.W. Bush, accepted virtually every argument advanced by opponents of Proposition 8. They said the prohibition on same-sex marriage violated the U.S. Constitution's 14th Amendment guarantees of due process and equal protection.

(Appeal of ruling could delay weddings)

"To characterize plaintiffs' objective as 'the right to same-sex marriage' would suggest that plaintiffs seek something different from what opposite-sex couples across the state enjoy -- namely, marriage," Walker wrote. "Rather, plaintiffs ask California to recognize their relationships for what they are: marriages."

(Obama: I'm against gay marriage and Prop 8)

Walker said the decisions of voters must be respected. But because the right to marriage is fundamental, he wrote, "voters' determinations must find at least some support in evidence. This is especially so when those determinations enact into law classifications of persons."