Stuart Gaffney, centre, celebrates the ruling striking down California's Proposition 8 outside the Phillip Burton Federal Building in San Francisco on Wednesday. ((Erik Risberg/Associated Press))

A U.S. Federal Court judge has overturned Proposition 8, California's same-sex marriage ban.

Chief U.S. District Judge Vaughn Walker ruled Wednesday that the voter-approved ban was unconstitutional.

Proposition 8 outlawed gay marriages in Callifornia, five months after they were legalized by the state's Supreme Court. The proposition was approved by 52 per cent of California voters in a referendum and passed by the state legislature.

Two gay couples who said the ban violated their civil rights were plaintiffs in the challenge.

Proposition 8 "fails to advance any rational basis for singling out gay men and women," Walker wrote in his ruling. "[This law] does nothing more than enshrine … that opposite-sex couples are superior."

The ruling is significant in that it's the first such ruling in a federal court. Numerous states have supported or challenged the legality of same-sex marriages on a state level, but Walker's ruling in a federal court opens the door to the issue eventually being appealed all the way to the U.S. Supreme Court.

"This ruling upholds that a government of the people, by the people and for the people cannot discriminate against the people," said Chad Griffin, one of the plaintiffs.

The ruling will almost certainly be appealed, which supporters on both sides of the issue had pledged to do if the court ruled against them.

Despite the favourable ruling for same-sex couples, gay marriage will not immediately resume in California. The judge issued a temporary stay that stops his ruling from being implemented. He said he wants to decide whether to suspend his decision while it goes through the appeal process.

Lawyers on both sides were given until Friday to submit written arguments.

The ruling "vindicates the rights of a minority of our citizens to be treated with decency and respect and equality in our system," said lawyer Theodore Olson, who delivered the closing argument at trial for opponents of the ban.

Olson, who served as solicitor general under the George W. Bush administration, teamed up with David Boies to argue the case, bringing together the two litigators best known for representing Bush and Al Gore in the disputed 2000 election.

Protect Marriage, the coalition of religious and conservative groups that sponsored the ban, said it would immediately appeal the ruling.

"In America, we should uphold and respect the right of people to make policy changes through the democratic process, especially changes that do nothing more than uphold the definition of marriage that has existed since the founding of this country and beyond," said Jim Campbell, a lawyer on the defence team.

The case would go first to the 9th U.S. Circuit Court of Appeals, then to the Supreme Court if the high court justices agree to hear it. Massachusetts, Iowa, Connecticut, Vermont, New Hampshire and Washington, D.C., all grant same-sex couples the right to wed.