The American Civil Liberties Union and advocacy groups filed a federal lawsuit today in response to a controversial North Carolina law that opponents say discriminates against lesbian, gay, bisexual and transgender communities.

The law, approved last week by the state legislature and signed by Gov. Pat McCrory, bans people from using bathrooms that don't match the sex indicated on their birth certificate. It also prevents North Carolina cities and counties from establishing ordinances that extend protections covering sexual orientation and gender identity to restaurants, hotels and stores.

A push by Republican leaders in the North Carolina General Assembly helped pass the law in an attempt to overturn a measure the city of Charlotte implemented last month that allowed transgender people to use the restroom aligned with their gender identity.

Many corporations and business leaders across the country have condemned the law. The ACLU's lawsuit was filed in conjunction with other advocacy groups that threatened legal action in response to the North Carolina bill in order to protect gay and transgender North Carolinians against discrimination.

"Lawmakers made no attempt to cloak their actions in a veneer of neutrality, instead openly and virulently attacking transgender people, who were falsely portrayed as predatory and dangerous to others," the lawsuit reads.

The plaintiffs in the case are Joaquín Carcaño, a transgender man and public health expert at the University of North Carolina-Chapel Hill; Payton Grey McGarry, a 20-year-old transgender man and student at the University of North Carolina-Greensboro; and Angela Gilmore, a lesbian who is the associate dean for academic affairs at North Carolina Central University. The suit argues that by requiring the plaintiffs to use bathrooms that don’t align with their gender identity, the state is violating their civil rights.

The defendants are Gov. McCrory, Attorney General Roy Cooper III and W. Louis Bissette Jr., the chairman of the Board of Governors of the University of North Carolina.

After signing the law last week, McCrory defended its intent in a statement, saying Charlotte’s ordinance on bathrooms was a “radical breach of trust” and the new North Carolina law would “stop this breach of basic privacy and etiquette.”

“The basic expectation of privacy in the most personal of settings, a restroom or locker room, for each gender was violated by government overreach and intrusion by the mayor and city council of Charlotte,” McCrory said.

The suit, which asks for an injunction to keep the law from being enforced, argues that North Carolina lawmakers are "explicitly writing discrimination against transgender people into state law."

The groups further pressed that lawmakers introduced and passed the law in a "process rife with procedural irregularities," and made no attempt to cloak the discriminatory focus.