North Carolina in the United States passed a law last week that requires transgender people to use public restrooms according to the gender specified in their birth certificates. On Monday, the transgender people filed a federal lawsuit in U.S. District Court for the Middle District of North Carolina citing personal safety and discrimination.

“By singling out LGBT people for disfavored treatment and explicitly writing discrimination against transgender people into state law, (the state) violates the most basic guarantees of equal treatment and the U.S. Constitution,” the Reuters quoted a statement in the lawsuit filed by the American Civil Liberties Union and Lambda Legal.

The law passed by North Carolina Governor Pat McCrory also banned cities from passing anti-discrimination ordinances for protecting gay and transgender people.

The lawsuit filed by the American Civil Liberties of North Carolina, Equality North Carolina, two transgender men and a lesbian demands the state law to be declared unconstitutional.

“While the discriminatory, stated focus of the legislature in passing H.B. 2 — the use of restrooms by transgender people — is on its own illegal and unconstitutional, H.B. 2 in facts wreaks far greater damage by also prohibiting local governments in North Carolina from enacting express anti-discrimination protections based on sexual orientation and gender identity,” said the lawsuit as quoted by the CNN.

The General Assembly went into a special session on Wednesday to push through the bill, which was signed by McCrory the same day.

While the legislation was criticised by rights groups like Equality North Carolina, it received substantial backing from the lawmakers.

“One of the biggest issues was about privacy,” said Tim Moore, North Carolina House Speaker. “The way the ordinance was written by (the) City Council in Charlotte, it would have allowed a man to go into a bathroom, locker or any changing facility, where women are — even if he was a man. We were concerned. Obviously, there is the security risk of a sexual predator, but there is the issue of privacy.”

Andrew Cuomo, New York state governor, signed an order on Monday blocking all non-essential travels to North Carolina. The ban came after the new law blocking anti-discrimination ordinances was passed in North Carolina.

“From Stonewall to marriage equality, our state has been a beacon of hope and equality for the LGBT community, and we will not stand idly by as misguided legislation replicates the discrimination of the past,” Cuomo was quoted as saying by the CBS New York. “As long as there is a law in North Carolina that creates the grounds for discrimination against LGBT people, I am barring non-essential state travel to that state.”