Two lawyers who squared off in the legal case that determined the 2000 U.S. presidential election joined forces on Wednesday to ask a federal court to halt California's same-sex marriage ban, despite warnings from gay rights advocates not to mount a federal challenge.

Ted Olson and David Boies, who opposed each other in the Bush v. Gore Supreme Court case, said that gays and lesbians were made into second-class citizens by California's voter-approved ban, known as Proposition 8.

They sued on behalf of two same-sex couples who want to marry but cannot because of the Prop 8's passage.

California's supreme court on Tuesday upheld the initiative, approved by voters in November. The decision said California's state constitution allows voters to make such changes despite broad protection for same-sex couples.

Prop 8 ended a brief period of legal same-sex marriage in California, begun when the same court opened the door to gay nuptials early in 2008.

Gay rights advocates, fearing a loss in the socially conservative top U.S. court, have avoided going to federal court after other state ballot box losses.

A federal lawsuit at this time is terribly risky, said Jenny Pizer, one of the lawyers for Lambda Legal who argued against Prop 8 before the California court.

Her organization, the American Civil Liberties Union and others said in a statement, without more groundwork, the U.S. Supreme Court likely is not yet ready to rule that same-sex couples cannot be barred from marriage.

Olson, who represented then-Texas Gov. George W. Bush, and Boies, who represented then-Vice President Al Gore in 2000, jointly filed the lawsuit on Friday, before the California court acted.

On Wednesday they asked for an injunction on Prop 8. In the lawsuit they argue that Proposition 8 violates the U.S. constitutional amendment guaranteeing equal rights and due process.

This unequal treatment of gays and lesbians denies them the basic liberties and equal protection under the law that are guaranteed by the Fourteenth Amendment of the United States Constitution, the lawsuit reads.

(Reporting by Steve Gorman, writing by Peter Henderson, Editing by Sandra Maler)