Attorney General Loretta E. Lynch (R) and Principal Deputy Assistant Attorney General Vanita Gupta, head of the Civil Rights Division, announce law enforcement action against the state of North Carolina in Washington, U.S., May 9, 2016. REUTERS/Joshua Roberts

The U.S. Justice Department on Monday said it has filed a federal lawsuit against North Carolina over House Bill 2, contending it violates the federal civil rights act of 1964.

The suit, filed in the Middle District of North Carolina, names as defendants Gov. Pat McCrory, the N.C. Department of Public Safety and the University of North Carolina. It charges that HB2 constitutes “a pattern or practice of employment discrimination on the basis of sex” in violation of Title VII of the civil rights act.

The news capped a day of escalation in the HB2 fight. Earlier Monday, the McCrory administration announced it had filed its own lawsuit, asking a federal court to clarify whether the controversial new law discriminates against transgender people as the U.S. Justice Department contends. The law was passed by the General Assembly after the city of Charlotte extended LGBT protections, including a provision that allowed transgender people the right to use the bathroom with which they identified.

The so-called bathroom law, passed in March, prohibits people from using public restrooms not corresponding to their biological sex.

It has thrust North Carolina into the center of a national debate over equality and privacy, and has now led the state into what could be a long and costly legal battle with the U.S. government.

Americans are divided over how public restrooms should be used by transgender people, according to a Reuters/Ipsos poll, with 44 percent saying people should use them according to their biological sex and 39 percent saying they should be used according to the gender with which they identify.

By passing the law, North Carolina became the first state in the country to ban people from using multiple occupancy restrooms or changing rooms in public buildings and schools that do not match the sex on their birth certificate.

U.S. Attorney General Loretta Lynch said on Monday the department “retains the option” of curtailing federal funding to North Carolina unless it backs down.

“None of us can stand by when a state enters the business of legislating identity and insists that a person pretend to be something or someone that they are not,” Lynch said at a news conference, comparing the measure to Jim Crow-era racial discrimination laws and bans on same-sex marriage.

Lynch said the department is monitoring other U.S. jurisdictions that have passed or considered laws similar to North Carolina’s but declined to say whether the agency was planning any action against them.

White House spokesman Josh Earnest called the North Carolina law “mean-spirited” but McCrory said in his complaint that it is “common sense privacy policy.”

North Carolina Republicans say the law stops men from posing as transgender to gain access to women’s restrooms.

BILLIONS AT STAKE

North Carolina stands to lose $4.8 billion in funds, mainly educational grants, if it does not back down, according to an analysis by lawyers at the University of California, Los Angeles Law School.

The Justice Department’s complaint named the state of North Carolina, McCrory, the state’s Department of Public Safety and the University of North Carolina system as defendants.

The 17-campus University of North Carolina system says it takes federal non-discrimination laws very seriously but must also adhere to state laws like HB 2.

“In these circumstances, the University is truly caught in the middle,” UNC President Margaret Spellings said.

McCrory told reporters that North Carolina had been forced to pass the law after the Charlotte city council passed an ordinance that allowed transgender people access to bathrooms based on gender identity in public and private buildings.

“We’re taking the Obama admin to court. They’re bypassing Congress, attempting to rewrite law & policies for the whole country, not just NC,” McCrory wrote on Twitter.

The Republican leaders of North Carolina’s state legislature also sued the U.S. government over the law on Monday, hours after McCrory’s lawsuit.

The law is also being challenged in federal district court by critics including the American Civil Liberties Union.

Read more at CharlotteObserver.com.