Connecticut's Supreme Court ruled Friday that gay couples have the right to marry, making the state the third behind Massachusetts and California to legalize such unions through the courts.

The ruling comes just weeks before Californians go to the polls on a historic gay-marriage ballot question, the first time the issue will be put before voters.

The 4-3 ruling is the first time that a state that had willingly offered an alternative to marriage was told by a court that civil unions aren't enough to protect the rights of gay couples. Connecticut was the first state to voluntarily pass laws to affirm civil unions.

"I can't believe it. We're thrilled, we're absolutely overjoyed. We're finally going to be able, after 33 years, to get married," said Janet Peck of Colchester, who was a plaintiff with her partner, Carole Conklin.

"I'm just ecstatic. It's such a relief, the joy of it," said another plaintiff, Jodi Mock of West Hartford, who sued with partner Elizabeth Kerrigan.

In the majority opinion, Justice Richard N. Palmer wrote that denying marriage to same-sex couples would create separate standards.

"Interpreting our state constitutional provisions in accordance with firmly established equal protection principles leads inevitably to the conclusion that gay persons are entitled to marry the otherwise qualified same sex partner of their choice," Palmer wrote.

The Family Institute of Connecticut, a political action group that opposes gay marriage, called the ruling outrageous.

"Even the legislature, as liberal as ours, decided that marriage is between a man and a woman," said executive director Peter Wolfgang. "This is about our right to govern ourselves. It is bigger than gay marriage."

Attorney General Richard Blumethal said the ruling will go into effect on Oct. 28, when it is implemented by action of the Superior Court. There will be no appeal, he said.

Gov. M. Jodi Rell said she disagreed with the ruling.

"The Supreme Court has spoken," said Rell, a Republican. "I do not believe their voice reflects the majority of the people of Connecticut. However, I am also firmly convinced that attempts to reverse this decision -- either legislatively or by amending the state Constitution -- will not meet with success."

But House Speaker Jim Amann, a Democrat, said he expects the issue to be taken up by the General Assembly.

"The legislature, as the lawmaking branch of government, debated this issue and made Connecticut one of the few states that offers civil union status for same-sex couples," Amann said.

The court was sharply divided in the decision, with three justices issuing separate dissenting opinions.

Justice Peter T. Zarella wrote that he believes there is no fundamental right to same-sex marriage, and the court's majority failed to discuss the purpose of marriage laws, which he said is to "privilege and regulate procreative conduct."

Zarella added, "The ancient definition of marriage as the union of one man and one woman has its basis in biology, not bigotry. If the state no longer has an interest in the regulation of procreation, then that is a decision for the legislature or the people of the state and not this court."

The lawsuit was brought in 2004 after eight same-sex couples were denied marriage licenses and sued, saying their constitutional rights to equal protection and due process were violated.

They said the state's marriage law, if applied only to heterosexual couples, denied them of the financial, social and emotional benefits of marriage.

Supreme courts in Massachusetts and California also have ruled in favor of gay and lesbian couples, concluding the domestic partnerships were unequal to the rights given in heterosexual marriage.

Civil unions and a similar arrangement, known as domestic partnerships, are offered to same-sex couples in Vermont, New Jersey, New Hampshire, Oregon, Hawaii, Maine, Washington and the District of Columbia.

Peck said that as soon as the decision was announced, the couple started crying and hugging while juggling excited phone calls from her brother and other friends and family.

"We've always dreamed of being married," she said. "Even though we were lesbians and didn't know if that would ever come true, we always dreamed of it."