"Essentially, this boils down to love. We love each other. We now have equal rights under the law," declared a jubilant Robin Tyler, a plaintiff in the case along with her partner. She added: "We're going to get married. No Tupperware, please."
A crowd of people raised their fists in triumph inside City Hall, and people wrapped themselves in the rainbow-colored gay-pride flag outside the courthouse. In the Castro, long the center of the gay community in San Francisco, Tim Oviatt wept as he watched the news on TV.
"I've been waiting for this all my life. This is a life-affirming moment," he said.
By the afternoon, gay and lesbian couples had already started lining up at San Francisco City Hall to make appointments to get marriage licenses. In West Hollywood, supporters planned to serve "wedding cake" at an evening celebration.
James Dobson -- chairman of the conservative Christian group Focus on the Family, which has spent thousands of dollars to get the measure on the ballot -- called the ruling an outrage.
"It will be up to the people of California to preserve traditional marriage by passing a constitutional amendment. ... Only then can they protect themselves from this latest example of judicial tyranny," he said in an e-mailed statement.
In its 4-3 ruling, the Republican-dominated high court struck down state laws against same-sex marriage and said domestic partnerships that provide many of the rights and benefits of matrimony are not enough.
"In contrast to earlier times, our state now recognizes that an individual's capacity to establish a loving and long-term committed relationship with another person and responsibly to care for and raise children does not depend upon the individual's sexual orientation," Chief Justice Ronald George wrote for the majority in ringing language that delighted gay rights activists.
Massachusetts in 2004 became the first, and so far only, state to legalize gay marriage; more than 9,500 couples have taken advantage of the law. But the California ruling is considered monumental by virtue of the state's size -- 38 million out of a U.S. population of 302 million -- and its historical role as the vanguard of many social and cultural changes that have swept the country since World War II.
California has an estimated 108,734 same-sex households, according to 2006 census figures.
"It's about human dignity. It's about human rights. It's about time in California," San Francisco Mayor Gavin Newsom, pumping his fist in the air, told a roaring crowd at City Hall. "As California goes, so goes the rest of the nation. It's inevitable. This door's wide open now. It's going to happen, whether you like it or not."
Unlike Massachusetts, California has no residency requirement for obtaining a marriage license, meaning gays nationwide are likely to flock to the state to be wed, said Jennifer Pizer, an attorney who worked on the case.
The ultimate reach of the ruling could be limited, however, since most states do not recognize same-sex marriages performed elsewhere. Nor does the federal government.
The conservative Alliance Defense Fund said it would ask the justices for a stay of the decision until after the fall election in hopes of adding California to the list of 26 states that have approved constitutional amendments banning same-sex marriage.
"We're obviously very disappointed in the decision. The remedy is a constitutional amendment. The constitution defines marriage as a union between one man and one woman," said Glen Lavy, senior counsel for the organization.
Opponents of gay marriage could also ask the high court to reconsider. If the court rejects such a request, same-sex couples could start getting married in 30 days, the time it typically takes for the justices' opinions to become final.
Attorney General Jerry Brown, whose office had argued to uphold the ban, said Brown will work with Gov. Arnold Schwarzenegger and state agencies to implement the ruling.
The case was set in motion in 2004 when the mayor of San Francisco -- the unofficial capital of gay America -- threw City Hall open to gay couples to get married in a calculated challenge to California law. Four thousand wed before the Supreme Court put a halt to the practice after a month.
Two dozen gay couples then sued, along with the city and gay rights organizations.
Thursday's ruling could alter the dynamics of the presidential race, as well as state and congressional contests in California and beyond, by causing a backlash among conservatives and drawing them to the polls in large numbers.
A spokesman for Republican John McCain, who opposes gay marriage, said the Arizona senator "doesn't believe judges should be making these decisions." The campaigns of Democrats Barack Obama and Hillary Rodham Clinton said they believe that the issue of marriage should be left to the states.
Ten states now offer some form of legal recognition to same-sex couples -- in most cases, domestic partnerships or civil unions. In the past few years, the courts in New York, New Jersey and Washington state have refused to allow gay marriage.
Outside the San Francisco courthouse, gay marriage supporters cried and cheered as news of the decision spread. Jeanie Rizzo, one of the plaintiffs, called Pali Cooper, her partner of 19 years, via cell phone and asked, "Pali, will you marry me?"
California already offers same-sex couples who register as domestic partners many of the legal rights and responsibilities afforded to married couples, including the right to divorce and to sue for child support.
Citing a 1948 California Supreme Court decision that overturned a ban on interracial marriages, the justices struck down the state's 1977 one-man, one-woman marriage law, as well as a similar, voter-approved law that passed with 61 percent in 2000.
The chief justice was joined by Justices Joyce Kennard and Kathryn Werdegar, all three of whom were appointed by Republican governors, and Justice Carlos Moreno, the only member of the court appointed by a Democrat.
In a dissent, Justice Marvin Baxter agreed with many arguments of the majority but said that the court overstepped its authority and that changes to marriage laws should be decided by the voters. Justices Ming Chin and Carol Corrigan also dissented.
California's secretary of state is expected to rule by the end of June whether the sponsors gathered enough signatures to put the amendment on the ballot.
Schwarzenegger, a Republican who has twice vetoed legislation that would have granted marriage to same-sex couples, said in a statement that he respected the court's decision and "will not support an amendment to the constitution that would overturn this state Supreme Court ruling."