Gay marriage has become legal in Arizona after the state’s conservative attorney general said Friday that he wouldn’t challenge a federal court decision that cleared the way for same-sex unions in the state.

It was a sharp turn. Less than a year ago Arizona was ground zero in the clash over gay rights after the overwhelmingly Republican state Legislature passed a measure that would have allowed businesses to deny service to gays and lesbians.

The announcement from Attorney General Tom Horne prompted gay couples to line up at the courthouse in downtown Phoenix, where they began to marry immediately.

David Larance and Kevin Patterson, who were among the couples who sued to overturn the state’s same-sex marriage ban, waited in the growing line for wedding licenses and reflected on the effect of the ruling. “The best way I can describe it, is that it gives me such peace of mind,” Patterson said, choking back tears.

Shortly after they were married to cheers on the courthouse lawn. “This is a great day,” Patterson said. “I never thought this would happen in Arizona.”

The decision bookends two weeks of nonstop court rulings across the nation, with judges striking down bans on same-sex unions and conservative state officials pushing back in a struggle that has increasingly gone in favor of gay marriage supporters.

Since Oct. 6 — when the U.S. Supreme Court let stand rulings from three appeals courts that struck down bans on gay and lesbian marriages — same-sex couples have begun to wed in several new states.

In the West, for example, couples have since tied the knot in Alaska, Arizona, Idaho and Nevada, making Montana the lone state under the jurisdiction of the 9th U.S. Circuit Court of Appeals where same-sex couples haven’t legally wed.

The federal government, meanwhile, announced Friday morning that it will recognize same-sex marriages in seven new states and extend federal benefits to those couples, which brings the total number of states where gay and lesbian unions have federal recognition to 26, plus the District of Columbia.

Based on the flurry of recent court decisions, including separate decisions Friday that apply to Arizona and Alaska, more than 30 states now extend marriage rights to gay couples, and cases are pending in several others.

Arizona’s governor, Jan Brewer, who has clashed with President Barack Obama over immigration and other issues, said in a statement that federal courts have gone against the will of voters and eroded the state’s power.

“Simply put, courts should not be in the business of making and changing laws based on their personal agendas,” Brewer said. “It is not the role of the judiciary to determine that same-sex marriages should be allowed.”

The issue has been a source of tension in Arizona. Nearly eight months ago, Brewer vetoed the bill that would have protected people who assert their religious belief in refusing service to gays. It would have allowed people to claim their religious beliefs as a defense against claims of discrimination. Critics called it an open attack on gay people, saying said it could allow people to break nearly any law and cite religious freedom as a defense.

The proposal set off a national debate over religion and discrimination. Companies such as Apple Inc. and American Airlines urged Brewer to veto the bill, saying it would hurt the state and could alienate businesses looking to expand there.

Horne, meanwhile, said he’s done all he could to defend the ban and that further court wrangling would waste taxpayer dollars.

“The probability of the 9th Circuit reversing today’s District Court decision is zero. The probability of the United States Supreme Court accepting review of the 9th Circuit decision is also zero,” he said.

The decision from U.S. District Judge John Sedwick bars Arizona officials from enforcing a 1996 state law and a 2008 voter-approved constitutional amendment that outlawed gay marriage.

Lawyers who pushed lawsuits challenging the state’s gay marriage ban argued the state law violated equal protection and due process rights and wrongfully denied their clients the benefits of marriage, such as spousal pension benefits, spousal survivorship rights and the ability to make medical decisions for each other.

Attorneys representing the state urged Sedwick to uphold the state’s definition of a marriage as a union between a man and woman. They argued the ban furthers the state’s interest in connecting a child to his or her biological mother and father and that voters and lawmakers enacted the ban to protect their right to define marriage for their community.

After the attorney general said the state would not fight to stop weddings, a crowd of about a dozen gay couples cheered and rushed into the clerk’s office, smiling and hugging.

Michael K. Jeanes, the clerk who oversees the state’s most populous county, which includes Phoenix, tweeted immediately after the ruling: “Welcome All to the Clerk’s Office. Your marriage license awaits and we are ready to serve you!”

___

Brian Skoloff and Steve Fluty of The Associated Press contributed to this report.