The Department of Justice is suing North Carolina over its same-sex bathroom law

The US Justice Department on Monday filed a complaint against North Carolina over its controversial transgender bathroom law, saying the law constituted a pattern and practice of discrimination and violated the Civil Rights Act.

The law, signed by Governor Pat McCrory in March, prevents local governments in North Carolina from passing nondiscrimination ordinances, and bans transgender people from using the bathroom that corresponds with their gender identity.

The state of North Carolina, McCrory, the state’s Department of Public Safety, and the University of North Carolina were named as defendants in the lawsuit.

According to a statement from the Justice Department, the law is in violation of Title VII of the Civil Rights Act, Title IX of the Education Acts Amendment of 1972, and the Violence Against Women Reauthorization Act, all of which bar discrimination based on sex.

Speaking at a press conference, Attorney General Loretta Lynch called the law “impermissibly discriminatory,” and compared the struggle transgender Americans are facing to civil-rights battles against women and African-Americans.

“It was not so very long ago that states, including North Carolina, had signs above restrooms, water fountains and on public accommodations keeping people out based upon a distinction without a difference,” she said.

Lynch made it clear that the law puts North Carolina, and particularly the 17-school University of North Carolina system, at risk of losing federal funding. Some have estimated the potential losses in funding as high as $1.4 billion.

Earlier Monday, North Carolina sued the federal government for mandating the state abandon the law.