The Arizona Senate voted Wednesday to approve legislation that would expand religious freedom — a measure opponents say would create a "separate unequal class" and allow discrimination against LGBT people.

Senators in the state voted 17-13 on the measure, Senate Bill 1062, advancing it to the state's House, despite the sudden failure of similar legislation in four other states on Tuesday.

Specifically, the bill would prevent the state from taking action against individuals and businesses who refuse services to people or groups based on their religious beliefs if such enforcement would "substantially burden" the free exercise of their religion.

A companion bill is expected to pass in the House in the coming days, according to the Arizona Senate Democratic Caucus, which opposes the bill because it "conflates discrimination with religious freedom."

"SB 1062 permits discrimination under the guise of religious freedom," Senate Democratic Leader Anna Tovar said in a statement. "With the express consent of Republicans in this Legislature, many Arizonans will find themselves members of a separate and unequal class under this law because of their sexual orientation. This bill may also open the door to discriminate based on race, familial status, religion, sex, national origin, age or disability."

Republican Sen. Steve Yarbrough, a sponsor of the bill in the Senate, said he aims to protect religious freedoms and has cited a recent case in New Mexico, where the state supreme court held that a same-sex couple should be allowed to sue a photographer under the state's public accommodation law for refusing to photograph their wedding. That defendant in that case has asked the U.S. Supreme Court to review their First Amendment claims.

Arizona's public accommodation law does not include sexual orientation protections currently, according to the Arizona Attorney General's website, which formed the basis for the New Mexico lawsuit.