WASHINGTON (CNN) -- In a much-anticipated ruling issued Thursday, the California Supreme Court struck down the state's ban on same-sex marriage as unconstitutional.
Several gay and lesbian couples, along with the city of San Francisco and gay rights groups, sued to overturn state laws allowing only marriages between a man and a woman.
"There can be no doubt that extending the designation of marriage to same-sex couples, rather than denying it to all couples, is the equal protection remedy that is most consistent with our state's general legislative policy and preference," said the 120-page ruling.
It said that the state law's language "limiting the designation of marriage to a 'union between a man and a woman' is unconstitutional, and that the remaining statutory language must be understood as making the designation of marriage available to both opposite-sex and same-sex couples."
With the ruling, California becomes the second state to allow same-sex couples to legally wed. Massachusetts adopted the practice in 2004, and couples don't need to be state residents to wed there.
Vermont, New Jersey, New Hampshire and Connecticut permit civil unions, while California has a domestic-partner registration law. More than a dozen other states give gay couples some legal rights.