Presidents who have sought to intrude on the independence of the Justice Department have for decades been rebuked. President Trump has appeared to frequently cross that line, calling for investigations into Hillary Clinton and one of her aides and demanding that a career F.B.I. official politically aligned with her be removed from his job.

Talk of criminal charges for elected officials also exacerbated tensions between Mr. Trump and local politicians who disagree with his administration’s stance on immigration law enforcement, particularly in California, a state whose liberal residents have become a symbol of staunch opposition to much of the president’s agenda.

Last year, the Trump administration also threatened to withhold federal funding to sanctuary cities, including $28 million in law enforcement grants to state and local jurisdictions in California. In response, both the state and the city of San Francisco sued the administration. California Attorney General Xavier Becerra called the threat to withhold money “bullying.”

More recently, the state Legislature passed the California Values Act, which restricts cooperation with federal immigration agents. The law took effect on Jan. 1, drawing the ire of Thomas D. Homan, the acting director of Immigration and Customs Enforcement.

Mr. Homan said during an interview with Fox News that he had asked the Justice Department to “look into criminal charges for elected officials with sanctuary policies.” He also said that California officials should expect to see more ICE agents and deportation officers in the state.

“In every area, this administration has violated the norms of civil discourse and civil behavior,” said Darrell Steinberg, the mayor of Sacramento and an outspoken opponent of the Trump administration’s immigration policies. “There is a difference between the give and take of partisan politics and what we are witnessing today.”