There were softer appeals, as well. “I ask you to keep building bridges of love, of kindness to other people,” said José Castillo, the pastor of Our Lady of Mt. Carmel, the Catholic church where the rally was held.

Mr. Trump’s welcome committee of a few hundred people, many dressed in the flag, gathered for what was part pep rally and part celebration of what they viewed as the fulfillment of a campaign promise: the construction of a wall to keep undocumented Mexican immigrants away. To a scratchy rendition of Lee Greenwood’s “God Bless the U.S.A.,” mixed with clips of Mr. Trump’s acceptance speech at the 2016 Republican National Convention, supporters cast themselves as “deplorables” and enthusiastic gun owners, and hoped for a glimpse of the president’s motorcade.

“He said secure the borders, build the wall, everything,” said Julie Horn, explaining her support. Her husband, Scott, a retired construction worker, echoed her views. “I think he’s done great,” he said. As Trump supporters in California, they said they were living in the state only to be close to their grandchildren.

“You don’t put a Trump sticker on your car,” Ms. Horn said. “Your car will get smashed.”

Not all of the faces at the rally were white. Kathy Robinson, who is African-American and from Burbank, and who works as a wedding photographer and Uber driver, voted in 2016 for Hillary Clinton. But after the election, she said she regretted that, and had come to view undocumented immigrants as a menace who take jobs away from American citizens. “Trump is not racist,” she said. “He’s just against illegal immigrants. He loves black people.”

Later in the day, Mr. Trump addressed a hangar full of enthusiastic military service members at Marine Corps Air Station Miramar before attending a fund-raiser expected to raise $5 million at the home of Edward Glazer, a chairman of the Tampa Bay Buccaneers.

Mr. Trump has stayed away from California until now, realizing that the state is beyond his reach in 2020 if he runs for re-election, as he says he will. But he noted that he owns property in the state. “The taxes are way, way out of whack,” Mr. Trump said, “and people are going to start to move pretty soon.”