Shortly after Jeff Sessions became attorney general, he dismissed Hawaii as “an island in the Pacific” when a federal judge there blocked President Trump’s travel ban. He lashed out at New York City and Philadelphia for giving sanctuary to people in the country illegally. Last summer, he lambasted Chicago, tying its policies on undocumented immigrants to its soaring crime rates.

Sessions’s fiery speech on Wednesday excoriating California for laws he said impede immigration enforcement is the latest in a string of such attacks on states, cities and their leaders whose policies he perceives as liberal, radical and a violation of federal law. As a Republican senator from Alabama for 20 years, Sessions was known as an advocate for states’ rights. But, as attorney general, observers say, he is making an exception when state policies bump against his conservative agenda.

“As soon as Attorney General Sessions is able to craft federal policy that matches what he believes to be the interest and values of America, he is perfectly fine with strengthening the federal government and overcoming states’ rights,” said Benjamin E. Park, author of “American Nationalisms” and an assistant professor of history at Sam Houston State University. “States’ rights philosophies are always skin-deep and work until you want a strong federal government to support your policies.”

Justice Department spokesman Drew Hudson said Friday that Sessions is taking action against certain jurisdictions because he is committed to “the rule of law.”

“Under the Constitution and the principles of federalism, there is no question that states do not have the authority to nullify duly enacted federal law,” Hudson said in a statement. “The Attorney General is fulfilling his obligation to enforce federal law, which is indispensable to the proper functioning of a free and orderly society for all Americans.”

Sessions’s rhetoric reflects his long-held and passionate views on immigration, a stance that dovetails with President Trump’s policy agenda. Sessions had targeted “sanctuary” jurisdictions for months, although this week he sued to block three California laws that he alleged obstruct federal immigration authorities, his most aggressive step yet.

“How dare you? How dare you needlessly endanger the lives of our law enforcement officers to promote a radical open-borders agenda?” Sessions said in a speech, referring to Oakland Mayor Libby Schaaf (D), whose warning to her constituents last month, he said, disrupted an impending raid by Immigration and Customs Enforcement agents.

It’s not just immigration issues that have spurred Sessions to criticize local policies that he believes violate federal law. Earlier this year, Sessions took on states across the country that have paved the way for the burgeoning marijuana industry, undoing Obama-era Justice Department guidance and making it easier for U.S. prosecutors to enforce federal marijuana laws. Eight states and the District of Columbia have laws allowing for recreational marijuana consumption, according to NORML, a group that advocates legalization and tracks pot-related legislation. Many more states permit the use of medical marijuana.

“It is the mission of the Department of Justice to enforce the laws of the United States,” Sessions said when he made the January announcement.

In response, Colorado’s Republican senator, Cory Gardner, threatened to hold up the confirmation of nominees for key Justice Department leadership posts.

“This is a states’ rights issue, and the federal government has better things to focus on,” said Sen. Rand Paul (R-Ky.).

Sessions’s lawsuit and comments in California this week sparked backlash when he suggested, in his speech, that California’s actions were bucking the Constitution.

“Federal law is the supreme law of the land,” Sessions said. “I would invite any doubters to go to Gettysburg, or to the tombstones of John C. Calhoun and Abraham Lincoln. This matter has been settled.”

Gov. Jerry Brown said the attorney general was “basically going to war against the state of California,” and Sen. Kamala D. Harris (D-Calif.) said he should have known that his Civil War references would “be interpreted as highly offensive.”

Supporters, though, argued that Sessions was acting in the name of public safety, and pointed to cases of undocumented immigrants being released from jail because of local jurisdictions’ policies and going on to commit crimes.

“In fact, the only war that has been declared by the Attorney General and the Trump Administration is on violent crime, transnational criminal organizations, and the drug crisis,” Justice Department spokeswoman Sarah Isgur Flores wrote on Twitter after Brown’s comments.

“The Attorney General didn’t create this issue,” Flores added later. “But he cannot accept unconstitutional interference with federal law enforcement from any state.”

Although the Justice Department suing states is uncommon, it is not unheard of. The Obama Justice Department did so several times — over voting and transgender rights in Texas and North Carolina, and over a controversial immigration law in Arizona.

But state and local leaders in the states being criticized are incensed by the nature of Sessions’s attacks.

Last April, Sessions appeared on a radio show and suggested that a federal judge in Hawaii should not be able to strike down Trump’s travel ban.

“I really am amazed that a judge sitting on an island in the Pacific can issue an order that stops the president of the United States from what appears to be clearly his statutory and constitutional power,” Sessions said.

Nadine Y. Ando, president of the Hawaii State Bar Association, said that in criticizing the judge, Sessions managed to “demean the entire state.”

“Excuse me?” Ando said at the time. “We have been a state for 58 years. We’re not just some island.”

Sen. Mazie K. Hirono (D-Hawaii) said in an interview Friday that although Sessions and other Republicans posit themselves as favoring states’ rights, they are willing to cast that stance aside when it suits their agenda.

“There is no consistency in their position, so they often argue states’ rights when it suits their ideological purposes and positions,” she said.

In August, Sessions made a sweeping attack on Chicago, saying that “respect for the rule of law has broken down” there. In a speech, Sessions linked the increase in Chicago’s crime to its “so-called sanctuary policies.” Chicago is among the cities and counties that refuse to help detain and deport people who are in the country illegally.

When the U.S. Conference of Mayors was in Washington to meet at the White House in January, Sessions ratcheted up his crackdown on sanctuary jurisdictions, sending letters to 23 places and threatening subpoenas if they did not turn over documents proving their compliance with federal immigration law. Word got to the mayors as they huddled in a backroom preparing for a news conference, and several resolved they would skip the White House meeting.

“An attack on one of our cities mayors who are following the constitution is an attack on all of us,” said New Orleans Mayor Mitch Landrieu (D), president of the U.S. Conference of Mayors.