In what critics call a delay tactic, San Francisco is taking California to court on grounds its ban on same-sex marriages is unconstitutional.
The city, which filed the lawsuit late Thursday, has sanctioned more than 2,900 gay unions since it began defying state law last week.
Two judges already are considering challenges from conservative groups seeking to halt the marriage spree, and the city's lawsuit asks that those cases be consolidated.
Mayor Gavin Newsom said he doesn't regret giving out marriage licenses before the city sued the state but added he's glad the question is now in the courts.
"I think what we have done is affirm marriage here in San Francisco," Newsom said. "We affirmed it because we are celebrating people coming together in their unions. I feel affirmed as a married man by what's happened here in San Francisco."
A lawyer for a group trying to halt the gay marriages said the move was meant as a delay.
"This is as much a maneuver to keep this in court and keep the issue alive as it is anything else," said Benjamin Bull, an attorney with the Alliance Defense Fund.
The city is asking Superior Court Judge James Warren to declare unconstitutional three sections of the California Family Code that define marriage as a union between a man and a woman.
City officials want the judge to determine if barring same-sex couples from marrying violates the equal protection and due process clauses of the state constitution.
On Tuesday, Warren gave the city the choice of ending the same-sex wedding march or returning to court in late March to show why the process has not been halted. The city said it would continue issuing such licenses until forced to stop.
Judge Ronald Quidachay is considering a lawsuit filed by another conservative group, the Campaign for California Families. He said Tuesday he was not prepared to issue a ruling, and scheduled another hearing for Friday.
Like the city, conservatives want the two cases consolidated into one, but they want Quidachay to hear it instead of Warren.
Gov. Arnold Schwarzenegger said San Francisco's same-sex marriage licenses do not meet legal standards.
Meanwhile, New Mexico's Sandoval County said it will issue marriage licenses to same-sex couples because it had no legal grounds to refuse them.
New Mexico law defines marriage as a civil contract between contracting parties and does not mention gender.
"This office won't say no until shown it's not permissible," said Victoria Dunlap, county clerk of Sandoval County, which is home to 90,000 people just north of Albuquerque.