Four rights groups on Monday filed a legal challenge in federal court to a North Carolina law that nullified Charlotte's LGBT protections ordinance.

The American Civil Liberties Union (ACLU), the ACLU of North Carolina, Lambda Legal and Equality North Carolina filed the lawsuit on behalf of three plaintiffs in the U.S. District Court for the Middle District of North Carolina.

House Bill 2 prohibits cities and towns from enacting measures that prohibit discrimination based on sexual orientation or gender identity and bars students attending public institutions from using the bathroom that does not conform to their gender at birth.

At a press conference announcing the lawsuit, Chris Brook, legal director of the ACLU of North Carolina, said that the law violated the Fourteenth Amendment of the U.S. Constitution and Title IX of the Education Act of 1972.

“We are asking the court to overturn House Bill 2 because it is unconstitutional; because it violates the equal protection and due process clauses of the Fourteenth Amendment; because it discriminates on the basis of sex and sexual orientation; and because it is an invasion of privacy for transgender men and transgender women. The law also violates Title IX by discriminating against students on the basis of sex,” Brook said.

“As many of you know, this sweeping and discriminatory measure was introduced, passed and signed into law in just 12 hours at a cost of $42,000 to taxpayers without advance public notice, virtually no opportunity for public debate.”

“The Legislature and Governor McCrory have done nothing less than encourage discrimination against thousands of LGBT people who call North Carolina home and countless others who may travel here. They have particularly targeted transgender North Carolinians with ugly and baseless vitriol that seeks to harm and marginalize an already vulnerable community,” he added.

House Bill 2 was a response to an LGBT protections ordinance set to take effect April 1 in Charlotte.

Republican Governor Pat McCrory defended the law on Friday: “In passing the bathroom ordinance, Charlotte was exceeding its authority and setting rules that had ramifications beyond the City of Charlotte.”