New Jersey is unconstitutionally denying federal benefits to gay couples and must allow them to marry, a judge ruled Friday.

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.