PHOENIX — The Arizona Legislature gave final approval Thursday to legislation that allows business owners asserting their religious beliefs to refuse service to gays and others, drawing backlash from Democrats who called the proposal “state-sanctioned discrimination” and an embarrassment.

The 33-27 vote by the House sends the legislation to Republican Gov. Jan Brewer and puts Arizona back at the forefront of a polarizing piece of legislation four years after the state enacted an immigration crackdown that caused a national furor.

Similar religious protection legislation has been introduced in Ohio, Mississippi, Idaho, South Dakota, Tennessee and Oklahoma, but Arizona’s plan is the only one that has passed.

Republicans stressed that the bill is about protecting religious freedom and not discrimination. They frequently cited the case of a New Mexico photographer who was sued after refusing to take wedding pictures of a gay couple and said Arizona needs a law to protect people in the state from heavy-handed actions by courts and law enforcement.

Opponents raised scenarios in which gay people in Arizona could be denied service at a restaurant or refused medical treatment if a business owner thought homosexuality was not in accordance with his religion.

The bill is backed by the Center for Arizona Policy, a social conservative group that opposes abortion and gay marriage. The group says the proposal is needed to protect against increasingly activist federal courts.