A New Jersey judge ruled on Friday that the state must allow same-sex couples to marry, saying that not doing so deprives them of rights that were guaranteed by the United States Supreme Court in June.

It is the first time a court has struck down a state’s refusal to legalize same-sex marriage as a direct result of the Supreme Court ruling, and with lawsuits pending in other states, it could presage other successful challenges across the country.

The decision was a rebuff to Gov. Chris Christie, a Republican who vetoed a bill passed by the Legislature last year that would have allowed same-sex couples to marry. His office said it would appeal to the state’s highest court. And he is likely to seek a stay preventing same-sex marriages from beginning on Oct. 21, as the judge ordered.

New Jersey was particularly ripe for a challenge after the Supreme Court ruling, because of a previous ruling by the state’s highest court in 2006. In that decision, in the case Lewis v. Harris, the New Jersey Supreme Court ruled unanimously that same-sex couples were entitled to all of the rights and benefits of marriage. But the court stopped short of saying they had a fundamental right to marry, and in an unusual step instructed the Legislature to define how to confer equal protection.