The southwestern state of Arizona has passed a law allowing businesses to refuse to serve gay people if homosexuality is against their religious beliefs.
After sailing through the state legislature, the law is awaiting final confirmation from its governor, Jan Brewer, who has gained a reputation for her right-leaning stance on sensitive social issues such as immigration and abortion.
Arizona is the only state to have passed such a law. It says that any obligation to serve homosexuals is a violation of religious freedom if someone's beliefs tell them that homosexuality is wrong.
If Brewer, a Republican, signs the legislation it will mean, for example, that restaurants could legally turn away homosexual couples or individuals seeking a meal, or a baker could refuse to bake a cake for a gay commitment ceremony. It was not clear how a customer's sexual orientation would be established.
The new law provoked outrage from homosexual groups and prompted the Democratic Party to declare it "state-sanctioned discrimination" and an embarrassment. Both sides claim they are protected by constitutional rights, so the issue may end up being settled by the courts.
Anna Tovar, the Democratic Party leader in the Arizona state senate, said: "With the express consent of Republicans in this legislature, many Arizonans will find themselves members of a separate and unequal class under the law because of their sexual orientation. [The law] permits discrimination under the guise of religious freedom."
Steve Yarborough, a senate Republican, argued: "This is not about allowing discrimination, it's about preventing discrimination against people who are clearly living out their faith."
The US constitution promotes equal treatment under the law and upholds the right to religious freedom. Seven other Republican-dominated states, including Ohio, Idaho and Tennessee, have tried to introduce similar bills but they have all failed or stalled. A similar bill in Kansas was blocked this month when Republicans in the state legislature sided with opposition Democrats, arguing that the law amounted to legalising discrimination.
"We see a growing hostility towards religion," said Josh Kredit, the legal counsel for supporters of the bill, which was passed by both houses of the Arizona state legislature this week.
The moves by conservative states amount to a backlash against the growing acceptance of gay equality across the US. Same-sex marriage is now legal in 17 states and attorneys-general and judges in traditionally conservative areas have spoken out against bans on gay marriage in Utah, Virginia and Nevada.
In Arizona, Brewer has previously struck down a bill like the one that passed this week, using her veto. She was embroiled in a tense political stand-off with opponents at the time and there was no indication whether she would confirm the new law.