Twenty-five years ago, in one of the first such rulings in the nation, the California Supreme Court decided that the state Constitution protects homosexuals from job discrimination by a public agency.
Eighteen years passed before the U.S. Supreme Court reached a similar ruling that gays could not be singled out for official discrimination because of "animus."
Now, with the issue of same-sex marriage headed for California's courts, gay rights advocates are counting on the state's history of rulings on their side.
The state Supreme Court is expected to decide this summer whether San Francisco Mayor Gavin Newsom exceeded his authority when he began issuing marriage licenses to same-sex couples. Many legal analysts expect Newsom to lose that fight.
But the more explosive legal question is whether the state law that limits marriage to "a man and a woman" violates anti-discrimination provisions in the state Constitution. That issue is scheduled to return to a state trial court Thursday, and eventually to reach the California Supreme Court.
In recent years, the state's high court has sided with gay advocates in cases involving insurance for people with HIV, adoptions by gay couples and police stings aimed at gay men looking for sexual partners.
"A long line of precedent shows that it is clear that California's equal protection clause is more extensive" than the protections provided nationally by the U.S. Constitution, said Brad Sears, director of the Williams Project on Sexual Orientation Law and Public Policy at UCLA Law School.
But the state Supreme Court also ruled six years ago that the Boy Scouts of America could legally exclude gays. Six of the seven justices who supported that ruling, written by Chief Justice Ronald M. George, remain on the court.
Some legal scholars who follow the court say they expect to see that more cautious approach prevail when gay marriage reaches the justices.
"I don't see that this court is going to be that different from what they were six years ago," said University of Santa Clara law professor Gerald Uelmen.
One of the rulings on which advocates of gay marriage plan to rely heavily is a 1948 decision that overturned the state's ban on interracial marriage. That case, Perez vs. Sharp, came nearly 20 years before the U.S. Supreme Court rejected similar laws nationwide.
"The legal analysis applied to the interracial marriage case is almost uncannily applicable" to gay marriage, said Shannon Minter, legal director for the National Center for Lesbian Rights.
On the other side, lawyers who have challenged same-sex marriages say the 1948 ruling won't help gay advocates.
The interracial marriage ban was motivated by hatred, said Glen Lavy, a lawyer with the Alliance Defense Fund, one of the groups that has challenged San Francisco's same-sex marriages. "In contrast, we have thousands of years of history establishing that marriage is a union of the opposite sexes," he said. "That history did not arise out of prejudice."
Legally, the issue of whether the state's marriage law violates the Constitution has two parts. First, the courts look to see if a law that is being challenged discriminates against an identifiable class of people. Then the question is whether the state has a valid or compelling reason to justify discriminating.
Officials in San Francisco, which began marrying gay couples Feb. 12, argue that California's laws on marriage discriminate on the bases of both gender and sexual orientation. The state has no valid reason for either form of discrimination in its marriage laws, they say.
If the courts were to accept that argument, they would have to rule that gay marriage is not just permitted, but required by the state Constitution -- the same decision the Supreme Judicial Court of Massachusetts came to last year.
Opponents of gay marriage say the laws do not discriminate on the basis of gender because marriage law applies to men and women equally.
"The gender argument for same-sex marriage is basically silly," Lavy said.
But the California Supreme Court rejected a similar argument in the interracial marriage case. Back then, the state argued that the ban on mixed-race marriage was not discriminatory because it equally affected both whites and nonwhites.
If the court agrees that current marriage laws discriminate on the basis of gender, the state will have to present compelling reasons to justify the discrimination -- a very high hurdle. The court in the past has ruled that the state Constitution limits gender discrimination as strictly as racial discrimination.
If the court dismisses the gender challenge, the case will rest on how the court looks at discrimination on the basis of sexual orientation. There is no question that prohibiting same-sex couples from marrying discriminates on the basis of sexual orientation.
The issue will be how strong a reason the state needs to justify such discrimination.
Federal courts have interpreted the U.S. Constitution to give the government more leeway in discriminating on the basis of sexual orientation than on race or gender.
The legal term is "rational basis" -- meaning that "you just have to have some even colorable grounds" to make the distinction valid, said Chapman University Law School professor John Eastman.
McGeorge School of Law professor J. Clark Kelso said foes of gay marriage could persuade the court that there is a rational basis for preferring heterosexual marriage "because it fosters a more stable society and it fosters greater likelihood that children will be adequately supported than any other choice."
But Therese M. Stewart, chief deputy city attorney for San Francisco and the lead lawyer in the case for gay marriage, said she would argue that there is a strong case for strictly limiting discrimination based on sexual orientation -- the same way discrimination based on gender and race is limited.
"I think there is plenty of authority that would give the court at least the basis for serious consideration whether gay men and lesbians should be entitled to that," she said.
Even if the court adopts that more protective standard, opponents of same-sex marriage say, there are reasons that would justify treating gay couples and heterosexual couples differently.
One of the major arguments they plan to make is that research shows a child is most likely to fare best when reared in a home with a mother and a father.
That argument also has echoes of one the court dismissed in 1948. At that time, lawyers for the state said the ban on interracial marriage was needed because the offspring of mixed-race couples would be physically "inferior."
Gay rights lawyers will point to the state's domestic-partners law to persuade the court that the state already is on record as supporting families headed by gay men and lesbians.
The law says it was intended "to further the state's interests in promoting stable and lasting family relationships."
"Expanding the rights and creating responsibilities of registered domestic partners would further California's interests in promoting family relationships and protecting family members during life crises, and would reduce discrimination on the bases of sex and sexual orientation in a manner consistent with the requirements of the California Constitution," the law says.
Citing such provisions, UCLA's Sears said the state courts would be "really up against a wall" in searching for a rational basis to deny gays the right to marry.
Those legal arguments do not get resolved in a vacuum, however. Unlike their predecessors, the seven justices who currently sit on the California Supreme Court have been "very reluctant" to get ahead of the U.S. Supreme Court on such cases, Uelmen said.
In particular, Chief Justice George, who is often a swing vote between the more liberal and more conservative factions of the court, prefers to "follow the lead of the U.S. Supreme Court" rather than be in front of it, Uelmen said.
Then there is a political element. Like the Massachusetts high court, the California Supreme Court has six Republicans and one Democrat. But members of the Massachusetts court are appointed for life. California's justices must appear on the ballot every 12 years, and some legal scholars believe that requirement could make the justices more cautious.
"The Massachusetts court is going to start taking a lot of hits," Uelmen said. "It already has started" with President Bush, he said.
"I think it has a chilling effect when the president refers to arbitrary court decisions and comes close to saying 'lunatic court decisions.' I think that will have a chilling effect on whether other courts would want to put themselves in this corner."
Kelso, too, is skeptical about the chances that gay marriage would prevail.
Despite precedents that might favor the gay-rights side, the California Supreme Court will "find itself on very uncertain, unstable terrain," the law professor said.
"I think they are likely to decide that gay marriage is not required under the California Constitutio