Domestic partnerships are not a good enough substitute for marriage, the justices ruled 4-3 in striking down the ban.
Outside the courthouse, gay marriage supporters cried and cheered as the news spread.
Four years ago Jeanne Rizzo and her partner Pali Cooper joined the flood of gay couples getting married at San Francisco's City Hall - but they were in line to get married when the State Supreme Court ordered the ceremonies to stop, reports CBS News correspondent John Blackstone.
Thursday, Rizzo phoned her partner of 19 years from the courthouse steps. "I don't know the details of the ruling but i think we're getting married pretty soon," Rizzo said.
In the Castro, historically a center of the gay community in San Francisco, Tim Oviatt started crying while watching the news on TV.
"I've been waiting for this all my life," he said. "This is a life-affirming moment."
The city of San Francisco, two dozen gay and lesbian couples and gay rights groups sued in March 2004 after the court halted the monthlong wedding march that took place when Mayor Gavin Newsom opened the doors of City Hall to same-sex marriages.
"Today the California Supreme Court took a giant leap to ensure that everybody - not just in the state of California, but throughout the country - will have equal treatment under the law," said City Attorney Dennis Herrera, who argued the case for San Francisco.
The challenge for gay rights advocates, however, is not over.
A coalition of religious and social conservative groups is attempting to put a measure on the November ballot that would enshrine laws banning gay marriage in the state constitution.
The Secretary of State is expected to rule by the end of June whether the sponsors gathered enough signatures to qualify the marriage amendment, similar to ones enacted in 26 other states.
If voters pass the measure in November, it would trump the court's decision.
"This was a bitterly divided ruling with one of the dissenting judges calling it the majority reasoning a case of 'legal jujitsu,' the creation of constitutional rights where none should have existed," says CBS News legal analyst Andrew Cohen. "I think that means we'll now see this move into the political realm -- with perhaps an attempt to amend the constitution to explicitly prohibit these sorts of marriages.
"Because there was such a slight consensus here, a 4-3 ruling with a concurring opinion, other state court judges who want to look to this case for guidance will really be able to find whatever they are looking for now matter which side of the issue they are on. And that pretty much eliminates the precedential value of this ruling beyond California's borders," Cohen said.
"The majority declared that the distinction between traditional marriage and same sex marriage, as recognized and established by the state legislature, cannot withstand constitutional scrutiny and that the alternative, domestic partnerships, just don't serve as an adequate substitute as a matter of law," Cohen added.
California already offers same-sex couples who register as domestic partners the same legal rights and responsibilities as married spouses, including the right to divorce and to sue for child support.
But, "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 Ron George wrote for the court's majority, which also included Justices Joyce Kennard, Kathryn Werdegar and Carlos Moreno.
In a dissenting opinion, Justice Marvin Baxter agreed with many arguments of the majority but said the court overstepped its authority. Changes to marriage laws should be decided by the voters, Baxter wrote. Justices Ming Chin and Carol Corrigan also dissented.
The conservative Alliance Defense Fund says it plans to ask the justices for a stay of their decision until after the fall election, said Glen Lavey, senior counsel for the group.
Gov. Arnold Schwarzenegger, who has twice vetoed legislation that would've granted marriage rights to same-sex couples, said in a news release that he respected the court's decision and "will not support an amendment to the constitution that would overturn this state Supreme Court ruling."
The last time California voters were asked to express their views on gay marriage at the ballot box was in 2000, the year after the Legislature enacted the first of a series of laws awarding spousal rights to domestic partners.
Proposition 22, which strengthened the state's 1978 one-man, one-woman marriage law with the words "Only marriage between a man and a woman is valid or recognized in California," passed with 61 percent of the vote.
The Supreme Court struck down both statutes with its sweeping opinion Thursday.
Lawyers for the gay couples had asked the court to overturn the laws as an unconstitutional civil rights violation that domestic partnerships cannot repair. A trial court judge in San Francisco agreed with gay rights advocates and voided the state's marriage laws in April 2005. A midlevel appeals court overturned his decision in October 2006.