Todd Crawford, left, and Jimmy Huckaby embrace after receiving their marriage license at the Santa Fe County Clerk's Office, Friday, Aug. 23, 2013. A New Mexico judge has ruled that Bernalillo County, which includes Albuquerque, must issue licenses to same-sex couples. Eddie Moore/The Albuquerque Journal/AP

A New Mexico judge on Monday declared same-sex marriage legal, ordering the clerk of the state's most populous county, Bernalillo, to join two other counties in issuing marriage licenses to gay and lesbian couples. The decision follows the Supreme Court's ruling in June that the Defense of Marriage Act, which barred the federal government from recognizing same-sex marriages, was unconstitutional.

State District Judge Alan Malott ruled that New Mexico's constitution prohibits discrimination on the basis of sexual orientation. The Bernalillo County Clerk's Office in Albuquerque planned to start issuing marriage licenses to same-sex couples at 8 a.m. Tuesday.

The decision came after a judge in Santa Fe directed the county clerk there to begin issuing marriage licenses to same-sex couples on Friday. But Malott's ruling was seen as having more impact because he explicitly declared that gay marriage was legal.

New Mexico has not passed legislation banning or specifically allowing same-sex marriage. On Feb. 20, 2004, Sandoval County Clerk Victoria Dunlap announced that she would begin issuing same-sex marriage licenses, since the state's marriage law did not specify gender. New Mexico's first same-sex marriage took place later that day.

Dunlap issued 66 licenses but stopped the same day. Patricia Madrid, New Mexico's then-attorney general, thought the licenses would be invalid, but a Santa Fe judge ruled in 2010 that at least one of the licenses was valid.

New Mexico has a law that recognizes any marriage license granted in another state. Thirteen states and the District of Columbia currently recognize same-sex marriage; six others allow civil unions or domestic partnerships.

Laura Schauer Ives, a lawyer for the American Civil Liberties Union of New Mexico, called Malott's decision "monumental" and said the group had not expected such a broad decision. The judge had been asked only to order that the state recognize on her death certificate a dying woman's marriage to her longtime partner.

But after a short hearing in which neither the counties nor the state objected to the request, Malott also ruled on the broader lawsuit by that couple and five others seeking marriage licenses.

"We were stunned and amazed," Ives said.

However, it's uncertain whether clerks in the state's 30 other counties, who were not defendants in the lawsuit, would use the judge's ruling as a signal that they could also issue marriage licenses to same-sex couples. State Assistant Attorney General Scott Fuqua said the decision was not binding on clerks outside Bernalillo and Santa Fe counties.