Updated

New Mexico became the latest state to legalize gay marriage Thursday as its highest court declared it is unconstitutional to deny marriage licenses to gay and lesbian couples.

Justice Edward L. Chavez said in a ruling that none of New Mexico's marriage statutes specifically prohibits same-gender marriages, but the state's laws as a whole have prevented gay and lesbian couples from marrying. The justices said same-sex couples are a discrete group that has been subjected to a history of discrimination and violence.

"Accordingly, New Mexico may neither constitutionally deny same-gender couples the right to marry nor deprive them of the rights, protections and responsibilities of marriage laws, unless the proponents of the legislation — the opponents of same-gender marriage — prove that the discrimination caused by the legislation is 'substantially related to an important government interest,'" Chavez wrote.

New Mexico joins 16 other states and the District of Columbia in allowing gay marriage either through legislation, court rulings or voter referendums.

Eight of the state's 33 counties started issuing marriage licenses to same-sex couples in August when a county clerk in southern New Mexico independently decided to allow the unions.

County officials had asked the high court to clarify the law and establish a uniform state policy on gay marriage.

State statutes don't explicitly prohibit or authorize gay marriage. However, county clerks historically have denied marriage licenses to same-sex couples because the law includes a marriage license application with sections for male and female applicants.

The ruling was a victory for gay rights activists who had been unable to win a legislative resolution of the issue.

"This truly is a historic and joyful day for New Mexico," ACLU-New Mexico Legal Director Laura Schauer Ives said. "The more than 1,000 same-sex couples who have already married in New Mexico can now rest certain knowing their marriages will be recognized and respected by our state."

The American Civil Liberties Union and the National Center for Lesbian Rights represented same-sex couples in the Supreme Court case. They contended gay marriage must be allowed because of constitutional guarantees of equal protection under the law and a state constitutional prohibition against discrimination based on sexual orientation.

Attorney General Gary King said he had yet to analyze the ruling but was pleased with the high court's decision.

Asked whether same-sex couples could feel confident in getting a marriage license in New Mexico, King said yes.

"Based on what I understand about the opinion, now in every county in New Mexico clerks will be required to issue marriage licenses to same-sex couples," he said. "And certainly it's been our position that if you're validly married in New Mexico under those provisions, that your marriage has the same legal effect as marriage between a heterosexual couple."

King acknowledged that the laws in New Mexico that led to the debate are very complex and that the Legislature likely will want to weigh in during the next legislative session.

The Democratic-controlled Legislature repeatedly has turned down proposals for domestic partnerships for same-sex couples and a constitutional amendment that would have allowed voters to decide whether to legalize gay marriage. Measures to ban same-sex marriage also have failed.

Sen. William Sharer, a Farmington Republican who opposes gay marriage, has said a constitutional amendment will be needed to resolve the issue regardless of the outcome of the court case.

The Flora Vista-based Voices for Family Values said its members already gathering signatures for petitions to present to state lawmaker during the upcoming session in January.

"Today, the New Mexico Supreme Court released their ruling which redefines marriage to mean something it was never meant to be," the group said in a statement. "Though this battle did not end in our favor, the war is far from over."

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino