A district judge in Mississippi blocked a law Thursday night that would have allowed anyone who holds a "sincere religious belief" to discriminate against LGBTQ people, less than an hour before it was set to go into effect.

Called the "Protecting Freedom of Conscience from Government Discrimination Act," the law sought to protect three core beliefs: that marriage should only be between a man and a woman, sex should only occur within marriage, and gender is determined at birth. It would have allowed anyone who holds these beliefs to refuse service to people with impunity. Several lawsuits were filed challenging the bill after it was signed into law in April. 

U.S. District Judge Carlton Reeves explained in his 60-page ruling the law "put its thumb on the scale to favor some religious beliefs over others" and would have encouraged "state-sanctioned discrimination on the basis of sexual orientation and gender identity." ​

The federal judge previously struck down part of the law on Monday that would have allowed clerks to deny gay couples marriage licenses, a decision lauded by LGBTQ proponents like the Human Rights Campaign, which said it would give "legal power to discrimination and hatred." Many conservative Christian groups supported the bill, including the Family Research Council, which gave Mississippi Governor Phil Bryant an award for signing it into law. 

Reeves called the legislation "the state's attempt to put LGBT citizens back in their place" after last summer's Supreme Court ruling making same-sex marriage legal nation-wide and said it violates the First and Fourteenth amendments of the constitution.

"In physics, every action has its equal and opposite reaction," Reeves wrote. "In politics, every action has its predictable overreaction."

Reeves issues a preliminary injunction to keep the law from going into effect on July 1. State attorneys are expected to appeal the ruling, 

"I look forward to an aggressive appeal," Governor Bryant said of the decision.