Bathroom stall sign
A sign protesting a recent North Carolina law restricting transgender bathroom access adorns the bathroom stalls at the 21C Museum Hotel in Durham, May 3, 2016. REUTERS/JONATHAN DRAKE

North Carolina officials sued the U.S. Justice Department on Monday to defend a law that restricts use of public restrooms, escalating a fight over the rights of transgender Americans.

North Carolina Gov. Pat McCrory, a Republican, and the state's secretary of public safety accused the agency of "baseless and blatant overreach."

In March, 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.

The Justice Department's top civil rights lawyer, Vanita Gupta, sent letters to North Carolina officials last week, saying the ban was a civil rights violation and the state could face a federal lawsuit if it did not stop enforcing it by Monday.

The North Carolina officials are now suing Gupta as well as U.S. Attorney General Loretta Lynch for their "radical reinterpretation" of federal civil rights law in federal district court in North Carolina.

"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.

McCrory told reporters that North Carolina leaders had been forced to pass the law, known as HB 2, after the Charlotte city council passed an ordinance requiring access to bathrooms based on gender identity in public as well as private buildings.

The Justice Department is expected to announce a “law enforcement action” related to North Carolina at 3:30 p.m. on Monday.

White House spokesman Josh Earnest called the North Carolina law “mean-spirited” in a media briefing on Monday, but referred questions about the lawsuit to the Justice Department.

The so-called bathroom law has thrust North Carolina into the center of a national debate over equality, privacy and religious freedom in the wake of a U.S. Supreme Court ruling last year that legalized same-sex marriage.

Prominent entertainers canceled performances in the state in protest of the law, associations relocated conventions and companies halted projects that would create jobs in the state.

On Monday, civil rights advocates in Mississippi sued to block a law allowing people to deny wedding services to same-sex couples based on religious objections.

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 biological sex and 39 percent saying they should be used according to the gender with which they identify.

The Justice Department had previously declined to say whether it would take legal action if the state stands by the law, but last week's letters suggested it was willing to do so, setting the stage for a potentially costly court battle.

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.

McCrory said in a statement that he had filed the suit to ensure that North Carolina continues to receive federal funding until a court resolves the dispute.

He noted his office had sought additional time to respond to the Justice Department letters but said the request was refused “unless the state agreed to unrealistic terms.”

Officials at the University of North Carolina system, who also received a civil rights violation notification letter from the Justice Department last week, did not join the suit that McCrory filed on Monday and could not be reached for comment.

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