PHOENIX — 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.

Arizona state capitol in Phoenix.

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.

“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 could come up for floor debate any day.

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. They said the bill would allow people to break nearly any law and cite religious freedom as a defense.

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

Arizona is one of five states where lawmakers introduced “religious freedom” bills targeting same-sex couples, mostly in response to the rapid advancement of marriage equality.