SANTA FE, N.M.— The New Mexico Supreme Court agreed Friday to decide once and for all whether same-sex marriage should be legal statewide after several counties recently began issuing marriage licenses to gay and lesbian couples, prompting a legal challenge.

Stepping into an intensifying debate over same-sex marriage in a state where such unions are neither expressly recognized nor prohibited by law, the high court set a hearing for Oct. 23 to consider a request from all 33 counties statewide to settle the matter.

All five of the justices concurred in ordering a review of the case without comment.

The justices had previously declined to intervene on the issue, saying they would leave it to the lower courts to rule on lawsuits being filed in different counties.

In August, a district judge in Santa Fe, the capital, ruled that New Mexico's constitution didn't bar same-sex matrimony and ordered a local government clerk there to either issue marriage licenses to same-sex couples or appear in court to explain why she couldn't.

Days later, a district judge in Bernalillo County, which includes Albuquerque, ruled that denying same-sex couples the right to marry violates state constitutional provisions guaranteeing equal protection under the law and barring gender-based discrimination.

The 33 county clerks, meanwhile, joined by the New Mexico Association of Counties, subsequently petitioned the high court to weigh in on the decision and decide whether the judge's ruling should extend statewide.

Separately, several Republican lawmakers filed a lawsuit challenging a Dona Ana County clerk who began voluntarily handing out marriage licenses to same-sex couples last month. Several counties have done likewise since then, some on their own and some under court order.

Both sides in the debate welcomed the intervention of the Supreme Court.

"I think it's excellent," said state Rep. Anna Crook, a Republican from the town of Clovis, one of 29 lawmakers who have so far joined the lawsuit in Dona Ana County. "It's been absolute chaos. We need to have a ruling one way or the other instead of 'my county can, yours can't.'"

A statement from the American Civil Liberties Union, representing couples in the Bernalillo County case, said gay rights proponents hope Friday's move "will lead to a speedy decision establishing the freedom to marry for all same-sex couples in New Mexico."

If same-sex marriage supporters prevail, New Mexico would join 13 other states and the District of Columbia in legalizing same-sex matrimony.

Related:

As courts weigh issue, NM county issues same-sex marriage licenses