Intensifying California’s standoff with the Trump administration over immigration policy, the California attorney general sued the Justice Department on Monday over the administration’s plans to cut off millions of dollars in federal funding to so-called sanctuary cities unless they begin cooperating with federal immigration agents.

The state’s attorney general, Xavier Becerra, argued in the lawsuit that the Justice Department’s threat, made by Attorney General Jeff Sessions last month, undermines public safety and violates the Constitution.

“It’s a low blow to our men and women who wear the badge for the federal government to threaten their crime-fighting resources in order to force them to do the work of the federal government,” Mr. Becerra said at a news conference. “We’re in the best position to determine how best to enforce the law and keep our people safe.”

Mr. Becerra’s suit is the latest in a barrage of legal challenges in California and elsewhere over President Trump’s efforts to compel cooperation from local governments on immigration policy. Chicago sued the Justice Department over the same federal grants last week, and San Francisco quietly filed a matching complaint on Friday.