WASHINGTON/WINSTON-SALEM, N.C. (Reuters) - A fight between the Obama administration and North Carolina over a state law limiting public bathroom access for transgender people escalated on Monday as both sides sued each other, trading accusations of civil rights violations and government overreach.

The U.S. Justice Department’s complaint asked a federal district court in North Carolina to declare that the state is violating the 1964 Civil Rights Act and order it to stop enforcing the ban.

Hours earlier, North Carolina’s Republican governor, Pat McCrory, and the state’s secretary of public safety sued the agency in a different federal court in North Carolina, accusing it of “baseless and blatant overreach.”

The so-called bathroom law, passed in March and known as HB 2, 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.

Slideshow ( 4 images )

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.

Slideshow ( 4 images )

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.