Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The Justice Department sued California late Tuesday, escalating the battle between the Trump administration and local governments over the issue of providing sanctuaries from a crackdown on immigration enforcement.

The lawsuit, which also names Gov. Jerry Brown and California Attorney General Xavier Becerra, challenges three recently passed state laws that the Trump administration says hinder enforcement of federal immigration law and endanger federal agents.

Attorney General Jeff Sessions announced the lawsuit Wednesday at an annual gathering of law enforcement organizations in Sacramento.

"California, we have a problem," Session said. He vowed that the "Department of Justice and the Trump administration are going to fight these unjust, unfair, and unconstitutional policies that have been imposed on you."

He also accused Oakland's mayor, Libby Schaaf, of needlessly endangering the lives of law enforcement officers last month when she issued a public warning of upcoming Immigration and Customs Enforcement raids across the Bay Area.

"So here’s my message to Mayor Schaaf: How dare you. How dare you needlessly endanger the lives of law enforcement officers to promote a radical open borders agenda," Sessions said.

In signing the bills into law last October, Brown said they strike "a balance that will protect public safety while bringing a measure of comfort to those families who are now living in fear every day."

Jerry Brown, left, walks home with his campaign manager Steven Glazer after voting June 8, 2010 in Oakland, California. Justin Sullivan / Getty Images file

The laws provide some of the most generous protections in the nation for immigrants facing deportation, but the Justice Department argues that they improperly venture into the enforcement of U.S. immigration law that is strictly a matter for federal authorities.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

DOJ lawyers consider the laws to be a novel attempt to regulate federal immigration.

The lawsuit, filed in federal court in the state capital, Sacramento, challenges three specific laws:

— SB 54, which restricts law enforcement officials from notifying federal immigration agents about the release dates for prisoners in their custody who have been convicted and therefore face deportation. It also prohibits local officials from transferring those prisoners to federal custody.

As a result, the Justice Department says, immigration agents face greater danger in re-arresting the former prisoners once they're back on the streets.

— AB 450, which forbids private employers from cooperating with immigration agents who conduct worksite enforcement operations. The law also requires employers to tell their workers when federal agents are coming to conduct inspections.

The Justice Department said a committee of the state legislature described the law as an effort to frustrate "an expected increase in federal immigration enforcement actions."

— And AB 103, which requires the state to inspect detention facilities where federal authorities are holding immigrants who face deportation.

Related: Department of Justice demands documents over sanctuary cities

Supporters of the laws argue they make communities safer by encouraging undocumented victims of crime to come forward without fear of being detained. But the Justice Department has questioned why California, after arresting someone for violating a state law, then hinders federal efforts to deport the offender. Immigrants who commit crimes are a priority for deportation.

The suit asks a federal judge to declare the state laws invalid and block their enforcement. It is separate from other cases, now working their way through the courts, that are challenging the Justice Department's efforts to withhold federal crime-fighting funds from sanctuary communities.

Brown and Becerra issued a tough denunciation of Sessions' action, accusing him of a political stunt designed to advance his standing with Trump rather than to clear up immigration disputes.

"This is basically going to war against the state of California, the engine of the American economy," Brown said at a press conference Wednesday in Sacramento. "It’s not wise. It’s not right. And it will not stand."

Brown accused Sessions of lying about California's immigration policies, rejecting the attorney general's claims that the state wanted an open border, to protect criminals and to secede from the United States.

“We know the Trump administration is full of liars," Brown said. "They have plead guilty already to the special counsel."

Gov. Jerry Brown responds to AG Sessions' immigration enforcement lawsuit: "This is basically going to war against the state of California." https://t.co/CIvcSulVEs pic.twitter.com/JkMNqgztUp — NBC News (@NBCNews) March 7, 2018

Becerra said in a conference call with reporters Tuesday evening that his office would be reviewing the claims in the announced lawsuit, but said that local and federal law enforcement officials work together to fight gangs, sex trafficking and other issues, adding, "The reality is we have no intention of changing that in California."

But Becerra said that states have the right under the 10th Amendment of the Constitution to determine for themselves how best to handle public safety. He said that based on his understanding of the claims made in the lawsuit, it "demonstrates there's nothing really new there that we weren't already familiar with."

"So we're prepared to deal with this," Becerra said. "We believe we are in full compliance with the federal constitution and federal law."

No matter what happens in Washington, #California will stay the course and enforce all our laws and protect all our people. That’s how we keep our communities safe. #Immigration — Xavier Becerra (@AGBecerra) March 7, 2018

Brown said in a statement that "at a time of unprecedented political turmoil, Jeff Sessions has come to California to further divide and polarize America."

"Jeff, these political stunts may be the norm in Washington, but they don’t work here. SAD!!!" Brown said, using language the president is known for.