California's Supreme Court on Thursday overturned a state ban on gay marriage, paving the way for same-sex couples in the country's largest state to tie the knot.

In a 4-3 decision, the justices ruled that domestic partnerships are not a good enough substitute for marriage.

The state 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 sue for child support.

"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.

The decision was a closely watched one and makes California only the second state after Massachusetts to allow same-sex marriages.

Cheers, proposals outside court

Outside the courthouse, gay marriage supporters cheered and cried as news of the decision came out.

One of the plaintiffs, Jeanie Rizzo, called her partner of 19 years and proposed, "Pali, will you marry me?"

"This is just such freedom for us," Rizzo said. "This is a message that says all of us are entitled to human dignity."

"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 City of San Francisco, two dozen gay and lesbian couples and gay rights groups sued in March 2004 after a court stopped same-sex marriages allowed by San Francisco's mayor.

In 2004, San Francisco Mayor Gavin Newsom ordered city officials to allow gay and lesbian couples to tie the knot, sparking hundreds of marriages that were later invalidated.

Ruling faces challenges

The ruling takes effect in 30 days and a large number of marriages is expected, CBC's Steve Futterman reported from the courthouse in San Francisco.

However, the decision could be overturned.

A coalition of religious and social-conservative groups is trying to include a measure in the ballot for the November general election that would enshrine laws banning gay marriage in the state constitution.

A ruling about whether the sponsors gathered enough signatures to qualify to put the amendment on the ballot is expected by the end of June. If voters pass the measure, it would trump the court's decision.

In a dissenting opinion, Justice Marvin Baxter said the court overstepped its authority and that changes would be decided by the voters.

Gov. Arnold Schwarzenegger, who has twice vetoed legislation that would have 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."

With files from the Canadian Press