SAN DIEGO — President Trump, on his first trip to California since taking office, on Tuesday trashed the state’s Democratic governor, saying Jerry Brown is a “nice guy” but doing a “terrible job.”

Trump’s comments came as he toured eight prototypes for his long-promised U.S.-Mexico border wall at a site southeast of downtown.

“I think Governor 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 in the sanctuary cities.”

Trump also noted that he owns property in California — a home in Beverly Hills and a golf club in Rancho Palos Verdes.

“The taxes are way, way out of whack, and people are going to start to move pretty soon,” Trump predicted.

Brown responded on Twitter, thanking Trump for the “shout-out.”

“But bridges are still better than walls,” Brown said. “And California remains the 6th largest economy in the world and the most prosperous state in America.”

The governor added: “#Facts.”

In a letter sent to Trump the day ahead of his visit, Brown encouraged Trump to visit the state’s Central Valley, where preparations are underway for a bullet train from San Francisco to Los Angeles — including the construction of bridges to accommodate the high-speed line.

“You see, in California we are focusing on bridges, not walls,” Brown said in the letter, in which he also noted that past presidents have used their inaugural visits to the state to celebrate its diversity.

Last week, Brown accused the Trump administration of “basically going to war against the state of California” after Attorney General Jeff Sessions traveled to the state to announce a lawsuit that aims to compel California to cooperate with Trump’s agenda of stepped-up immigrant deportations.

While in California, Trump also addressed military personnel at Marine Corps Air Station Miramar before traveling to the Los Angeles area for a fundraiser to benefit the Republican National Committee.

Trump has no plans to meet with Brown or other Democratic leaders of the state, which Trump lost to Democratic presidential nominee Hillary Clinton in 2016 by more than 4 million votes.