New Mexico’s highest court unanimously ruled Thursday it is unconstitutional to deny a marriage license to same-sex couples, making it the newest state to legalize gay weddings.

The Supreme Court justices said the state must respect the marriages of all same-sex couples, including those who wed before their decision. Prior to the ruling, county clerks in eight New Mexico counties had started issuing marriage licenses to hundreds of same-sex couples.