The West Virginia Senate on Wednesday rejected a “religious freedom” bill that critics say would put the LGBT community at risk for discrimination.

Last month, the West Virginia House of Delegates overwhelmingly approved the West Virginia Religious Freedom Restoration Act (HB 4012), which states that the state “may not substantially burden a person's right to exercise of religion” without a “compelling interest.”

The Senate voted down the bill with a 27-7 vote after amending the bill to state that it could not be used to get around nondiscrimination ordinances and laws.

Republican Senator Robert Karnes said that the amendment “effectively turned this bill into a 'discriminate against religious people bill'” and promised to return next year.

The Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, praised the vote.

“For one day at least, West Virginia is spared from legislation that would increase the likelihood of unacceptable discrimination and a flood of expensive legal challenges,” said HRC Legal Director Sarah Warbelow. “Unfortunately, despite today's events, more work lies ahead. LGBT West Virginians still remain at risk for being fired or denied a job because of who they are, or whom they love.”