Ruling 4 to3, the court found marriage to be a "fundamental constitutional right," and to deny that right to same-sex couples would require a compelling government interest. The Republican-dominated court said the state had failed to show such an interest.
Unlike in Massachusetts, nothing prevents out-of-state same-sex couples from coming to California to get married.
"The invitation is going to be a kind of come one, come all, and that's going to produce a large number of [gay] marriages," says Douglas Kmiec, law professor at Pepperdine University. "They will then return to their home communities and will insist the states recognize their marriages as valid."
The decision also sets up political confrontations at the ballot box in November, at the state level and possibly within the presidential contest.
After the Massachusetts ruling in 2003, ballot initiatives opposing gay marriage brought voters out to the polls, and according to some research, possibly tipped the 2004 election to President Bush. The new ruling is unlikely to have the same effect in 2008, when deep dissatisfaction with the economy and the war will make it hard for social issues like gay marriage to gain traction, say most experts.
"[T]here's no question that the Republicans will try to use it, and I think with some voters it may be a powerful issue. But the important thing is that the context has shifted dramatically since 2004," says Bruce Cain, a professor of political science at University of California at Berkeley.
Unlike in 2004, the Republicans face an economic downturn, an unpopular president, and Democrats making gains among voters in party affiliation, says Dr. Cain.
Nationally, 27 percent of Republicans now rank gay marriage as a major issue, according to research by the Pew Center. Since 2005, public opinion on the issue has stabilized, with 55 percent opposed and 36 percent in favor.
"Now the question is whether this brings it back as an issue. The historical pattern suggests there might be some greater visibility, but this has not been a major issue for a few years, so we'll have to wait and see what happens," says Carroll Doherty, associate director at the Pew Research Center for the People & the Press.
An upgrading of the issue might spell trouble for Democrats.
Voters in Florida – a potential battleground state – will vote on a ballot initiative in November to ban same-sex marriage that could galvanize conservatives to vote.
There's also a question mark around the reaction of evangelical voters, who have recently begun to drift away from the GOP. There are reasons to suspect this ruling won't affect that shift greatly, says Ivan Strenski, a professor of religious studies at the University of California at Riverside. "We know that that shift among Evangelicals is partly a generational one, and we know that in the younger generations, they don't care about this."
The most immediate battle ahead will be in November, when Californians are likely to get the chance to vote on an initiative that would effectively reverse the court ruling. Sponsors of a state constitutional amendment banning same-sex marriage have gathered more than 1.1 million signatures – enough to put it on the ballot.
Californians have split nearly evenly for years on the question. In June 2007, 45 percent favored allowing gay marriage and 49 percent opposed it, according to the Public Policy Institute of California (PPIC).
"Democrats are strongly in favor, Republicans are strongly opposed. It's a very sharp political divide on this question," says Mark Baldassare, PPIC president.
The case arose from San Francisco Mayor Gavin Newsom's instruction to the city clerk in 2004 to issue marriage licenses for same-sex couples. In the month that followed, nearly 4,000 same-sex couples got married before California's high court stepped in to halt the marriages and ultimately nullify them.
That brought lawsuits from some of the couples. The trial court found that codes barring same-sex marriages violated equal protection guarantees in the state's constitution. An appeals court reversed the decision, saying legal discrimination could be avoided through domestic partnership arrangements.
Writing for the majority in Thursday's ruling, Chief Justice Ron George found "that retention of the traditional definition of marriage does not constitute a state interest sufficiently compelling, under the strict scrutiny equal protection standard, to justify withholding that status from same-sex couples."
Gay marriage opponents are incensed. "On a 4-3 vote, the California Supreme Court has destroyed the civil institution of marriage between a man and a woman," said Randy Thomasson, president of Campaign for Children and Families. "This arrogant judicial activism took 121 pages of contorted logic to explain ... [and] should be short-lived."
Public support nationally for gay marriage grew steadily throughout the late 1990s and into the early part of this decade. That changed in 2003, following the US Supreme Court's ruling in Lawrence and Garner v. Texas, which struck down laws against sodomy. Then the Massachusetts Supreme Court legalized gay marriage in the state.
These decisions raised the visibility of the issue and rallied opponents, says Mr. Doherty with Pew. From July 2003 to February 2004, support nationally for gay marriage dropped from 38 percent to 30 percent, and opposition spiked 10 points to 63 percent.
In response to the court actions, activists placed measures to ban gay marriage on the November 2004 ballots in 11 states. Some – most notably Ohio – occurred in key battleground states in the presidential election.
"Other issues may have kept Bush even with [Democrat John] Kerry in Ohio, but gay marriage may very well have put Bush over the top in the state," Dr. Donovan found.
More than half the states have amended their constitutions to prohibit same-sex marriages. And three state supreme courts have ruled against a constitutional right to gay marriage. Connecticut's high court is expected to rule on the issue within months.
"No state is immunized categorically or as a settled matter to California marriages today. They may think they are," says Mr. Kmiec, "but I don't think they are free from legal challenge."
States that actually amended their constitution, as opposed to passing a statute, will have a greater likelihood of sustaining their rejection of California marriages, he says.