This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

JACKSON, Miss. — A federal judge blocked a controversial Mississippi law that would’ve gone into effect Friday, which would’ve allowed businesses and government employees to deny services to gay and transgender people based on religious grounds.

U.S. District Court Judge Carlton Reeves issued a 60-page opinion in which he described the Mississippi law, known as House Bill 1523, as “state-sanctioned discrimination.”

“There are almost endless explanations for how HB 1523 condones discrimination against the LGBT community, but in its simplest terms it denies LGBT citizens equal protection under the law,” he wrote.

He cited many reasons in his opinion.

The law would create a separate system “designed to diminish the rights of LGBT citizens” thus violating the equal protection guaranteed by the Fourteenth Amendment.

He also wrote that it gave an official preference for certain religious beliefs over others violating the First Amendment.

The plaintiffs who sued the state over the new law reflected a broad cross section of religious officials, LGBT advocates and other Mississippi residents, who argued that HB 1523 violated their constitutional rights.

Reeves ruled in their favor, writing that “the bill creates a statewide two-tiered system that elevates heterosexual citizens and demeans LGBT citizens.” He granted a preliminary injunction Thursday night.

In a nutshell, HB 1523 would have shielded private businesses and some public-sector employees from legal action and discipline if they refused a customer on the grounds that doing so would violate a “sincerely held religious belief.”

The Mississippi law, called the Protecting Freedom of Conscience from Government Discrimination Act, had been passed directly as a result of the U.S. Supreme Court’s 2015 same-sex marriage ruling. It was one of many similar measures enacted in the United States in the year following that landmark decision.

Under the law, religious organizations would’ve been able to deny LGBT people marriage, adoption and foster care services; fire or refuse to employ them; and decline to rent or sell them property. Medical professionals would’ve been permitted to refuse to participate in treatments, counseling and surgery related to “sex reassignment or gender identity transitioning.”

It would’ve allowed vital-records clerks and their deputies to decline to issue marriage licenses because of “a sincerely held religious belief or moral conviction” and also allowed judges, magistrates, justices of the peace and their deputies to decline to perform them.

Proponents, including Mississippi governor Phil Bryant, had defended the law as a way to prevent discrimination against people like him — Christians with deeply held religious beliefs about marriage and sex. Supporters of the law have said that the government, by condoning same-sex marriage, was discriminating against religious citizens who had differing views.

But Reeves struck down that notion.

Reeves wrote that the Mississippi law granted “special rights” to certain citizens who held beliefs “reflecting disapproval of lesbian, gay, transgender, and unmarried persons.”

Reeves wrote that people who held contrary religious beliefs would remain unprotected, meaning “the State has put its thumb on the scale to favor some religious beliefs over others,” which is a violation of the Establishment Clause.

“That violates both the guarantee of religious neutrality and the promise of equal protection of the laws,” the judge wrote.

The law would essence create an “official preference” for certain religious tenets while offering no protection for people who had differing beliefs.

“HB 1523 does not advance the interest the State says it does. Under the guise of providing additional protection for religious exercise, it creates a vehicle for state-sanctioned discrimination on the basis of sexual orientation and gender identity. It is not rationally related to a legitimate end.”