President Donald Trump said he would “confront dangerous sanctuary cities” as he visited border wall prototypes in California Tuesday.

The president viewed eight potential prototypes in San Diego that could deliver on his paramount campaign promise — to build a “great, big beautiful wall.”

“If you didn’t have walls over here, you wouldn’t have a country,” Trump said, acknowledging some of the existing border wall infrastructure. “The state of California is begging us to build a wall. They don’t talk about that.”

Trump blasted California’s Democratic Gov. Jerry Brown on his visit, saying that “he’s done a very poor job running California.”

“It’s out of control,” Trump said, pointing to the mayor of Oakland, who issued a warning last month that Immigration and Customs Enforcement (ICE) could be conducting a raid in the area, saying that she felt it was her “duty and moral obligation as mayor to give those families fair warning when that threat appears imminent.”

OAKLAND MAYOR WARNS OF IMPENDING ICE RAID, RAMPING UP SANCTUARY-CITY TENSION

California has landed in Trump’s political crosshairs when it comes to immigration -- it calls itself a ‘sanctuary state,’ meaning local law enforcement officials do not comply with state or federal immigration laws. The state has filed 28 lawsuits against the administration.

But Brown did not seem to be “begging” for a wall. The governor has said the state is at "war" with the Trump administration. And even penned a letter to Trump that read: “You see, in California we are focusing on bridges, not walls. And that’s more than just a figure of speech.”

“California — they’re the best friend of the criminal,” Trump said Tuesday, saying the state is “very dangerous” for “policy and law enforcement folks.”

On his visit, the president called on Congress to pass, in the upcoming omnibus bill, funding for the border wall, and approve a measure to prohibit grants from jurisdictions not complying with federal immigration law.

TRUMP VISITS BORDER WALL PROTOTYPES IN CALIFORNIA AS STATE IS AT 'WAR' WITH ADMINISTRATION

“We are going to confront dangerous sanctuary cities,” Trump said. “I am calling on Congress to deliver a budget that protects our homeland and properly funds all of our law enforcement needs.”

He added: “Sanctuary cities are protecting a horrible group of people in many cases. Criminals. What happened in Oakland was a disgrace to our nation.”

Department of Homeland Security Secretary Kirstjen Nielsen touted the president on his “continued leadership.”

“We will build this wall, so thank you for coming out today,” Nielsen said. “We look forward to breaking ground very soon and securing our country.”

Fox News' Kristin Brown, Jennifer Bowman and William Lajeunesse contributed to this report.