Arizona Gov. Jan Brewer (R) announced Wednesday night that she has vetoed a controversial bill that would have allowed businesses to deny service to gays and lesbians if they felt it violated their religious rights.

Gay rights advocates have denounced the legislation, labeling it a form of legalized discrimination, and Arizona's two GOP senators and leading Republican candidates for governor urged Brewer to veto the bill. Even a few GOP state legislators who voted for the measure now say it is not the right thing to do.

Brewer said in a brief press conference that the bill "does not address a specific or pressing concern" and that it is not part of her agenda.

"I have not heard of one example in Arizona where business owners' religious liberty has been violated," Brewer said. "The bill is broadly worded, and could result in unintended and negative consequences."

Brewer told the bill's supporters that she understands their desire to protect religious liberty, but that the bill had the potential to cause more problems than it would solve.

Her official Twitter account tweeted the following picture shortly after her announcement:

The legislation was passed in response to a ruling by the New Mexico state Supreme Court against a wedding photographer who declined to work for a couple's same-sex wedding.

It is the latest in a long line of controversial pieces of legislation in Arizona. The state in recent years was the first to pass a restrictive immigration law -- which other states have since emulated and part of which was struck down by the U.S. Supreme Court -- and also passed legislation requiring presidential candidates to show proof of citizenship in order to appear on the state's ballot (in response to conspiracy theories about President Obama's birthplace). Brewer vetoed the latter bill.

Earlier this year, the state Republican Party voted to censure Sen. John McCain (R-Ariz.) for what it labeled his "liberal" voting record.

McCain was among those praising Brewer for her veto.

"I appreciate the decision made by Governor Brewer to veto this legislation," McCain said in a statement. "I hope that we can now move on from this controversy and assure the American people that everyone is welcome to live, work and enjoy our beautiful State of Arizona.”

Supporters of the bill say it was narrowly tailored and would have helped clear up an ambiguity in the state's law.

"This measure should have been a political no-brainer and only went down because people either chose to ignore the plain language of the bill or refused to read it altogether," said Tony Perkins, head of the conservative Family Research Council. "This bill ... bars government discrimination against religious exercise, so by vetoing this bill Gov. Brewer is saying she supports government discrimination against people's religious freedoms."

Among the strongest opponents of the bill were Arizona businesses who worried that it could cost them customers. Some big-name companies, including Apple and American Airlines, publicly opposed the bill.

The state lost the Super Bowl in the early 1990s after it declined to make Martin Luther King Day a state holiday. It is set to host the 2015 Super Bowl, and the Super Bowl's host committee spoke out against the law Monday.

Chad Griffin, head of the gay rights group Human Rights Campaign, said Brewer's veto "spared her state from institutional discrimination and economic catastrophe."

The bill passed through the GOP-controlled state legislature quickly last week, with the state Senate voting for it 17-13 on Wednesday and the state House approving it 33-27 on Thursday. Every Republican voted for it, with the exception of three House Republicans.

A similar bill in the Kansas legislature was squashed this month after business groups cried foul.

Brewer said at the end of her press conference that she hoped the controversy would ultimately help the two sides of the debate come together.

"Going forward, let's turn the ugliness of the debate over Senate Bill 1062 into a renewed search for greater respect and understanding among all Arizonans and Americans," Brewer said.

Updated at 8:33 p.m.