The Arizona Senate on Wednesday passed a bill backed by Republicans that expands the rights of people to assert their religious beliefs in refusing service to gays and others, a measure Democrats say will open the doors for discrimination and hurt the state economy.

Democrats and civil rights groups opposed the bill that was pushed by social conservatives, saying it would allow discriminatory actions by businesses.

But sponsor Sen. Steve Yarbrough of Chandler said his push for Senate Bill 1062 was prompted by a New Mexico case in which the state Supreme Court allowed a gay couple to sue a photographer who refused to take pictures of their wedding. He says he's protecting religious rights.

"This bill is not about allowing discrimination," Yarbrough said during a debate that stretched for nearly two hours. "This bill is about preventing discrimination against people who are clearly living out their faith."

The bill passed on a 17-13 party-line vote.

Democrats sponsored eight hostile amendments in an effort to sidetrack the legislation, but they were steadily rejected by Republicans who control the Senate.

Democrats repeatedly said they believed Yarbrough's legislation was clearly designed to allow discrimination.

"The heart of this bill would allow for discrimination versus gays and lesbians," said Sen. Steve Gallardo, D-Phoenix. "You can't argue the fact that bill will invite discrimination. That's the point of this bill. It is."

Sen. Steve Farley, D-Tucson, warned of economic consequences if the Legislature passed the bill and it is signed by Republican Gov. Jan Brewer. He said companies would begin to avoid Arizona, as they did after the state passed its signature immigration crackdown law, SB1070, in 2010.

"I think this bill makes a statement ... that we don't welcome people here," Farley said. "This bill gets in the way, this bill sends the wrong message around the country and around the world."

A similar bill is making its way through the Arizona House and is set for floor debate Thursday afternoon. It is expected to win approval from majority Republicans in that chamber as well and could be on Brewer's desk early next week.

The proposals are backed by the powerful Center for Arizona Policy, a social conservative group that backs anti-abortion and conservative Christian legislation in the state.

The bill is similar to a proposal last year brought by Yarbrough but vetoed by Brewer. That legislation would have allowed people or religious groups to sue if they believed they might be subject to a government regulation that infringed on their religious rights. Yarbrough stripped a provision from the bill in hopes Brewer will embrace the new version.

Civil-liberties and secular groups countered that Yarbrough and the Center for Arizona Policy had sought to minimize concerns that last year's bill had far-reaching and hidden implications. During the Senate debate Wednesday, Democrats said the bill could allow people to break nearly any law and cite religious freedom as a defense.

Yarbrough called those worries "unrealistic and unsupported hypotheticals" and said criminal laws will continue to be prosecuted by the courts.

Senate President Andy Biggs, R-Gilbert, said the Democrats' rhetoric was misplaced.

"The implication that 1062 somehow legitimizes not only discrimination, which I don't think it does, but indeed legitimizes physical harm, oppression, raping and murder ... is simply inaccurate," Biggs said. "There are times ... that sometimes people's rhetoric tends to inflame instead of explain. And I would suggest if there is going to be a backlash because of 1062, it won't be because someone has read the content of this bill and recognizes that it is indeed tailored after Supreme Court cases dealing with First Amendment religious rights, it will because of the temperate and inaccurate rhetoric. That is my personal opinion."