WASHINGTON — The Justice Department sued North Carolina on Monday to stop what it called discrimination against transgender individuals, raising the stakes in a cultural and legal battle that has ramifications for other states and the 2016 election.

U.S. Attorney General Loretta Lynch personally announced the lawsuit, which argues North Carolina's so-called bathroom law violates parts of the Civil Rights Act of 1964 and other federal laws, and contends that the state is engaging in a “pattern or practice of sex discrimination.”

Lynch stepped in hours after North Carolina's Republican governor, Pat McCrory, had sued the Justice Department to prevent it from blocking implementation of the state law, which requires public agencies to deny transgender people access to multiple-occupancy bathrooms and changing rooms consistent with their gender identity.

At a news conference, Lynch linked the dispute to past civil rights struggles over equal access to housing, water fountains and other facilities.

“This action is about a great deal more than just bathrooms,” she said. This is “about the respect we accord our fellow citizens and the laws that we … have enacted to protect them.”

The federal suit names the state of North Carolina, Gov. McCrory, the state's Department of Public Safety, the University of North Carolina System and the UNC Board of Governors as defendants.

Since the Supreme Court last year upheld the right of same-sex couples to marry, state legislatures have taken up various bills to address the extent of rights for gays, lesbians and transgender people. In California on Monday, state Assembly members passed a proposal that would require all single-person public restrooms to be gender neutral. The legislation now moves to the state Senate.

North Carolina was the first state to pass a law that requires public bathrooms or changing facilities “be designated for and only used by individuals based on their biological sex.” More than half a dozen states are weighing similar legislation.

The Justice Department had set a Monday deadline for the state to explain how it would amend its law to meet federal standards. Federal officials had said the state could face a possible lawsuit and the potential loss of billions of dollars in federal funding for state agencies and universities.

“Denying such access to transgender individuals, whose gender identity is different from their gender assignment at birth, while affording it to similarly situated non-transgender employees violates” federal law, Vanita Gupta, who heads the department's civil rights division, wrote in a May 4 letter to the governor.

The state sued first Monday morning, accusing the federal government of “baseless and blatant overreach” by trying to block the state from enforcing its law.

“This is an attempt to unilaterally rewrite long-established federal civil rights laws in a manner that is wholly inconsistent with the intent of Congress and disregards decades of statutory interpretation by the courts,” claims the state suit.

Although Sen. Ted Cruz of Texas strongly supported the North Carolina law, he dropped out of the Republican presidential race last week. Donald Trump, the presumptive GOP nominee, has suggested the new law is unnecessary.

Legal experts say the Justice Department is likely to prevail in court. They cited a recent decision by the 4th U.S. Circuit Court of Appeals, which governs federal law in North Carolina, that found a transgender high school student who was born as a female could sue his school board in Virginia for discrimination because it banned his use of the boys' restroom. The appeals court ruled 2-1 that courts should defer to a U.S. Department of Education decision that transgender students can chose a restroom that corresponds to their gender identity.

Carl Tobias, a University of Richmond law professor, said the dispute may reach the Supreme Court. “North Carolina is on the cutting edge of this,” Tobias said, referring to the wave of pending legislation. “And on the merits, it seems to be in violation of federal law. The Justice Department has a duty to stop discrimination in the workplace and educational institutions.”

The North Carolina law requires transgender individuals to use public bathrooms and locker rooms that correspond to their biological sex or the gender on their birth certificates. It also blocks local governments from allowing transgender individuals to use bathrooms that correspond to their sexual identity.

The law applies to bathrooms in state government offices and facilities.

McCrory and other state Republican leaders have defended the law as necessary to protect women from sexual assault.

Associated Press contributed.

dwilber@tribpub.com