SAN DIEGO — President Donald Trump broke from his inspection of border wall prototypes near San Diego on Tuesday to castigate California’s Democratic state government, saying that Gov. Jerry Brown is “doing a terrible job running the state.”

Trump’s first visit to the nation’s most populous state is brief — just one day — but long on symbolism. He spent about an hour inspecting border wall prototypes built at his direction, spoke at the Marine Corps Air Station Miramar and will attend a fundraiser in near Beverly Hills that is expected to raise $5 million for the Republican National Committee.

The attention Trump wanted to bring to his signature issue, the border wall and related immigration crackdowns, was overshadowed, as often happens by the president’s own distracting actions — in this case a new round of chaos within his leadership team after his abrupt firing of Secretary of State Rex Tillerson. Trump called Tillerson as Air Force One was flying him to California, hours after firing his secretary via a morning tweet.

Trump appeared to relish his visit to the border wall prototypes, which stood as the physical manifestation of his central campaign promise. He spoke with border agents about the superiority of “see-through” walls, talked about the ugly aesthetics of current barriers and insisted the new versions would block smugglers who have the skills of “professional mountain climbers.”

“The ones that work the best aren’t necessarily the most expensive,” he said.

The president has yet to secure from Congress the $25 billion he seeks to build a wall and it’s not clear whether even that would be enough; one estimate put the cost as high as $100 billion. His campaign promise that Mexico would pay for the wall has been a nonstarter in that country.

On Tuesday, Trump introduced a new argument, asserting that “the wall will save hundreds of billions of dollars — many, many times what it will cost.” An administration official, who refused to be identified, said the savings — for which no substantiation was provided — would come from keeping out immigrants trying to enter illegally and in that way reduce costs for social services and law enforcement.

Yet several studies have shown that immigrants, both legal and illegal, benefit the economy by working and paying taxes and that many in the country illegally do not take advantage of government services for fear they will be discovered and deported.

Trump also insisted that California political leaders actually want walls, despite what they say in opposition. “The state of California is begging us to build walls in certain areas, they don’t tell you that,” he said.

That was hardly the only shot he took at state leaders and their policies, especially the so-called sanctuary laws that are the subject of a new administration lawsuit.

He said the laws limiting local government cooperation with federal immigration enforcement officers are “the best friend of the criminal … the smugglers, the traffickers, the gang members. They’re all taking refuge.”

Trump’s comments came a day after the spokesman for ICE’s San Francisco office, James Schwab, announced that he was resigning because of what he said were false claims by administration officials. Schwab said they inflated the number of suspected criminals that they said eluded capture in recent California raids because of warnings from Oakland Mayor Libby Schaaf, whom Trump lambasted yet again in San Diego.

He reserved special criticism for Brown, even as he called him a “nice guy.”

“Gov. Brown does a very poor job running California,” Trump said. “They have the highest taxes in the United States. The place is totally out of control. You have sanctuary cities where you have criminals living.”

Brown tweeted in response to Trump’s Twitter account, “Thanks for the shout-out, @realDonaldTrump. But bridges are still better than walls. And California remains the 6th largest economy in the world and the most prosperous state in America. #Facts”

Trump’s visit brings him to the home turf of the resistance movement against his presidency. Immigrant, labor and LGBTQ rights activists are protesting while Democratic lawmakers are competing to raise their own profiles by denouncing him loudest. Many Republican candidates are staying away, given Trump’s low popularity in the state.

Lt. Gov. Gavin Newsom, a front-runner in the governor’s race, released an online animated video Tuesday morning caricaturing the president and his immigration policies. One image shows Trump’s “Make America Great Again” slogan reimagined as “Make America White Again.”

“It’s official: Donald Trump finally worked up the nerve to visit California, bringing his fear-of-everything agenda with him,” Newsom says in a voiceover. “Let’s get real. Donald Trump’s border wall is a monument to idiocy. A 1,900-mile waste of taxpayer money that — news flash — is impossible to complete.”

The political action committee for Los Angeles Mayor Eric Garcetti, who is considering a run for president, is running ads coinciding with Trump’s arrival. In a fundraising email, Garcetti wrote, “There’s one thing you need to know: California Republicans and Donald Trump are like peas in a pod.”

No president has waited so long to visit California since Franklin D. Roosevelt, who came by train in an era when air travel was not routine. Trump will leave California on Wednesday for events in St. Louis before returning to Washington.

Trump used to boast that he could become the first GOP presidential candidate to win the state in nearly three decades, but wound up losing to Hillary Clinton by 4.3 million votes, leading to a loss in the popular vote that Trump often laments. In California, just 22 percent of voters approved of the job Trump was doing as president in a USC Dornsife/Los Angeles Times poll in November; 66 percent disapproved.

In a state so large, that still leaves millions of people eager to see the president clash with Democrats who control all the levers of power. Many of Trump’s supporters in other states also view California as a foil, given its liberal power base, strict environmental regulations and permissive attitude toward immigration.

Times staff writers Seema Mehta in Los Angeles and John Myers in Sacramento contributed to this report.

Follow the Bangor Daily News on Facebook for the latest Maine news.