OAKLAND, California (Reuters) - California’s ban on gay marriage goes to trial on Monday in a federal case that plaintiffs hope to take all the way to the U.S. Supreme Court and overturn bans throughout the nation.

Same-sex couples Paul Katami (L), Jeff Zarillo (2nd L), and Kris Perry (2nd R) and Sandy Stier pose for photographs before the start of their trial in San Francisco, January 11, 2010. California's ban on gay marriage goes to trial on Monday in a federal case that plaintiffs hope to take all the way to the U.S. Supreme Court and overturn bans throughout the nation. REUTERS/Robert Galbraith

Victory for gay rights groups in the Supreme Court, which might not choose to take the case if it is appealed that far, would make marriage a fundamental constitutional right without exception and overturn laws and state amendments limiting marriage to a man and a woman in 40 states.

A loss in the top court, two ranks above the action that starts on Monday, would derail efforts to win in state courts that have been a hallmark of the gay rights movement thus far.

The case begins in a San Francisco court presided over by District Court Chief Judge Vaughn Walker, who clearly enjoyed preliminary sessions, joking with lawyers between barrages of pointed questions.

The United States is divided on gay marriage. It is legal in only five states, although most of those, and the District of Columbia, approved it last year.

The approval of California’s Prop 8 in November 2008 was a sweet victory for social conservatives in a state with a liberal, trend-setting reputation and showed off the resounding success conservatives have had at the ballot box on the issue.

California’s top court had legalized gay marriage in the summer of 2008, months before Prop 8 passed.

Gay rights lawyers in the case describe their battle as a continuation of the fight against racist laws that had stopped whites and blacks from marrying. Marriage is a fundamental constitutional right and, in addition, gays and lesbians deserve special protection from discrimination, they say.

The lawyers defending the ban say long traditions limit marriage to heterosexual couples and that a state, without malice, can be cautious about changing the institution. Heterosexual couples can have children, which society needs to continue, they add.

While a court battle to the Supreme Court would stretch over years, the trial beginning on Monday may take only two weeks.

GAY PARENTS

“Issues about parents and children and the role of child rearing will be central to this case,” said Joan Hollinger, a lecturer in family law at the University of California, Berkeley.

The lack of societal acceptance of same-sex marriages was a problem for children of those relationships -- an argument for allowing gay marriage, she said.

Ted Olson and David Boies, two high-powered lawyers who faced off over the legality of George W. Bush’s election win as U.S. president against Al Gore in 2000, have joined forces in an odd-couple team fighting for gay marriage.

Andrew Koppelman, a professor of constitutional law at Northwestern University, said an appeal is certain no matter who wins in court in San Francisco.

If the appeals court were to side with the ban, the Supreme Court would probably leave it, but a victory by the gay rights advocates in the appeals court would force the Supreme Court to act, since it could not ignore such a momentous change.

“There is no way to keep this out of the Supreme Court if they win,” said Koppelman, who has written books arguing in favor of same-sex marriage but sees this push as ill-timed due to the composition of the nine-member top court.

“Who are going to be your five votes on the Supreme Court? I have trouble getting to one.”