Mr. Trump is flying into San Diego, where he will view prototypes of a border wall being built along the Mexican border, before speaking to troops at a nearby military base. From there, he is heading to Beverly Hills for a high-roller Republican fund-raiser before flying back to Washington on Wednesday morning. He is not planning to meet with any California leaders, or tour any part of the state outside that stretch along the border.
It is the first time the president has come to this state since he campaigned here during the Republican presidential primary nearly two years ago. His appearances at the time set off demonstrations and clashes with the police, including one in which his motorcade was blockaded by protesters as he turned up to speak at a state Republican Party convention outside San Francisco. (Mr. Trump was forced to leave his vehicle and trudge up a hill, climbing over a fence, to get into the venue).
Similar demonstrations are expected again. Protesters — and some supporters — are planning rallies in the San Diego area before the president’s visit on Tuesday. One group, Women’s March San Diego, is planning to erect a large sign in opposition to the border wall that the president would see from the air, should he fly in by helicopter. Another group, which calls itself San Diegans for Secure Borders, is planning a rally on Tuesday in support of the president’s immigration policies. Among those scheduled to attend, the group said, are “parents whose children were murdered by illegal aliens who crossed our unsecured border illegally to kill our citizens.”
Los Angeles is girding for protests as well, though demonstrators may be confused over where to go. The location of Mr. Trump’s fund-raiser, and where he is staying, has been kept secret. A spokeswoman for the Los Angeles Police Department, Officer Rosario Herrera, said no permits had been issued for major protests as of Monday morning, and that any road closings would be determined later in consultation with the Secret Service.
“We are prepared for anything that arises in the city of L.A,” she said.
Indeed, California Democrats seem eager for Mr. Trump’s arrival: the state Democratic leader, Kevin de León, who is running for Senate, called for a demonstration even before Mr. Trump takes off from Washington, on Monday next to the Beverly Hills sign, with labor and civil rights group.
Tensions between California and Washington have been high since Mr. Trump was elected, reflecting the decidedly different political philosophies between the president and many Democrats here. A poll by the Institute of Governmental Studies at the University of California, Berkeley, in December found that only 30 percent of respondents approved of his job performance; his national job approval rating has hovered around 40 percent, depending on the poll.
And California now looms as prime territory for Democrats seeking to retake Congress next year. At least seven Republican congressional seats in California are viewed as vulnerable, many of them located right near where Mr. Trump will be touching down. Republican strategists have advised candidates for office here to distance themselves from the president; a key question on Tuesday will be which, if any, Republican members of Congress will appear in public with the president.
Neither side appears inclined to calm the waters in advance of Mr. Trump’s visit. Mr. Sessions, in addition to challenging the three California immigration laws, has also threatened to bring obstruction of justice charges against Libby Schaaf, the Democratic mayor of Oakland, for warning constituents this month of impending raids by federal immigration officers. Over the weekend, the president used his weekly address to criticize the state’s immigration policies.
“California’s leaders are in open defiance of federal law,” Mr. Trump said. “They don’t care about crime. They don’t care about death and killings. They don’t care about robberies. They don’t care about the kind of things that you and I care about.”
Mayor Eric M. Garcetti of Los Angeles described Mr. Trump as being out of touch with the nation and the world. “Why would our president come all the way across the country to look at wall samples in a state where he’s taking away more people’s health care than anywhere else?” he said.
At a news conference Monday morning, Xavier Becerra, California’s attorney general, listed ways he sees his state as exceptional: “When President Trump comes to California, he’ll see a state that’s No.1 in manufacturing, agriculture, high-tech, in graduating young people from college,” he said.
“Our state is going to keep moving forward, keep welcoming people who want to work hard, no matter what happens in Washington,” he said.
Mr. Brown, who is entering his final year in office, used his letter to urge Mr. Trump to lend his support to the high-speed train line Mr. Brown has been trying to build between San Francisco and Los Angeles. The plan has been put in jeopardy because of cost overruns and opposition from Republicans in Washington.
“In California we are focusing on bridges, not walls,” Mr. Brown said. He urged the president to visit the Central Valley where “more than a dozen bridges and viaducts are being built for the nation’s first and only High-Speed Rail line.”
“You have lamented that ‘we don’t have one fast train’ in our country.” Mr. Brown said. “Well, Mr. President, in California we are trying to fix that. We have a world-class train system under construction. We invite you to come aboard and truly ‘Make America Great Again.’”
As California has emerged as the seat of the resistance to the Trump administration — on issues from immigration to climate change, to offshore oil drilling and marijuana policy — there has been a growing sense of separateness between here and the rest of the country.
Joe Mathews, a columnist for Zócalo Public Square, a nonprofit news site, recently compared California’s tenuous ties with the rest of America to mainland China’s relationship with Taiwan, which has its own ambitions of independence. Calling California a “halfway country” just like Taiwan, Mr. Mathews wrote, “our state has the ambitions, economy and democracy of a leading nation.”
With the exception of the Civil War and the civil rights battles of the 1960s, there appears little historical precedent for the kind of clashes — in language and policy — that are now on view between California and Washington. “There’s just a sense that the Trump presidency is moving the nation in the exact opposite direction from where California wants it to go,” said Manuel Pastor, a professor of sociology and American studies and ethnicity at the University of Southern California. “So the estrangement is quite high.”
Professor Pastor argues in a forthcoming book, “State of Resistance,” that California’s own measures against undocumented immigrants in the 1990s prefigured Mr. Trump’s hard-line positions on immigration. California voters approved a 1994 ballot initiative that would have cut off state benefits to illegal immigrants, a move that was championed by the Republican governor at the time, Pete Wilson. The initiative was thrown out in court, but the Republican embrace of it contributed to the party’s long decline in political power as the state became more Democratic and Latino.