Superior Court Judge Mary Jacobson sided almost entirely with a group of same-sex couples and gay rights groups who sued the state in July, days after the U.S. Supreme Court struck down key parts of a law that blocked the federal government from granting benefits to gay couples.

New Jersey allows same-sex couples to enter into civil unions that give them some of the same legal protections as married couples, but Jacobson said the two labels — marriage for opposite-sex couples and civil unions for same-sex couples — means gay couples are excluded "from certain federal benefits that legally married same-sex couples are able to enjoy."

VIDEOS

TOP JOBS

Same-sex couples who include a federal employee, those who want to use the federal Family Medical Leave Act or those who file joint federal tax returns are being hurt by the state's recognition of civil unions but not gay marriage, she wrote.

"Every day that the state does not allow same-sex couples to marry, plaintiffs are being harmed," Jacobson wrote in a 53-page opinion.

By making her order effective more than three weeks from now, the state has time to appeal to a higher court and ask for a delay to the start of same-sex marriage.

Gov. Chris Christie did not immediately say whether he would appeal, but he opposes gay marriage and had his administration defend the state's current policy this far.

"The judge has issued a very thorough and powerful opinion that shows the correctness under the constitution of our claims," said Hayley Gorenberg, a Lambda Legal lawyer who prepared the lawsuit. "It shows the deep error the state's been making in refusing to let people marry on an equal basis."

Marcye Nicholson-McFadden, one of the plaintiffs in the case, said she and her partner of 24 years, Karen Nicholson-McFadden, are trying to absorb the news.

"I want to shout from the rooftops, but I just have to keep myself in check," Marcye Nicholson-McFadden, of Aberdeen, said. "At the moment we're just waiting to see what the state will do."

Gay marriage supporters were planning to rally Friday night in Montclair to celebrate the ruling.

Thirteen states now recognize same-sex marriages, including the entire Northeast except for Pennsylvania and New Jersey.

It's been a major political and legal issue in New Jersey for more than a decade.

The state Supreme Court ruled unanimously in 2006 that same sex-couples had the right to the same legal protections as married couples, but a 4-3 majority ruled that the state did not have to go as far as calling those benefits marriage. Lawmakers responded by quickly creating civil unions.

In 2011, six couples and children of several of them asked the courts to find that the civil union law was not fulfilling its intention because it created a separate classification for gay couples that not everyone understood.

The state Supreme Court then decided against giving it emergency status and instead sent the issue back to a lower court.

But the U.S. Supreme Court ruling in June on the Defense of Marriage Act changed the argument and the couples asked anew for speedy relief.

Federal agencies have rolled out a variety of policies on whether they will recognize marriages of any gay couples, or only those in states that recognize their vows.