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

Judge Vaughn Walker wrote that Proposition 8, which voters approved as an amendment to the state constitution in 2008, "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 Vaughan, chief judge of the U.S. District Court for the Northern District of California in San Francisco.

The amendment outlawed same-sex marriage five months after the state Supreme Court legalized it. Walker was asked to decide whether limiting marriage to opposite-sex couples violated the U.S. Constitution's guarantees of due process and equal protection.

The ban's supporters said they would appeal to the U.S. Court of Appeals for the 9th Circuit. Walker stayed his ruling to give them time to argue that it should remain stayed while the case is on appeal.

"What's at stake here is bigger than California," Andrew Pugno, an attorney representing Proposition 8 supporters, said in a statement.

"Americans in numerous states have affirmed, and should be allowed to continue to affirm, a natural and historic public policy position like this. We are prepared to fight all the way to the U.S. Supreme Court if necessary."

David Boies, an attorney for the plaintiffs, said the judge agreed with the plaintiffs on every argument they made. "Discrimination against gays and lesbians is the last area where you have state-enforced discrimination, and this ruling goes a long way to eliminating that," Boies said.

Shortly after the ruling, he spoke at a news conference alongside his co-counsel, Ted Olson, and the four plaintiffs in the case, one lesbian couple and one gay couple who had tried to get married but were denied marriage licenses.

When asked if the couples planned to marry immediately, plaintiff Paul Katami responded, "I need time to order a cake."

In a statement, California Gov. Arnold Schwarzenegger, a Republican, 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."

Walker's ruling comes a month after a federal judge in Massachusetts struck down a 1996 law barring the federal government from recognizing gay marriages.

With the ruling in California, gay marriage is now legal in six states, including Massachusetts, and in Washington, D.C.

However, same-sex married couples are disqualified from receiving marriage-based federal benefits under the 1996 Defense of Marriage Act.