SAN DIEGO (AP) -- President Donald Trump eagerly inspected eight towering prototypes for his long-sought wall at the U.S.-Mexico border and accused California of putting "the entire nation at risk" by refusing to take tough action against illegal immigration.

Trump, making his first trip to California as president, said Tuesday he preferred a fully concrete wall because it was the hardest to climb, but he noted that it needed to be see-through. He said the first thing he noticed on the drive to the border was the patched-up holes in part of the existing fence.

"We have a lousy wall over here now, but at least it stops 90, 95 percent," Trump said. "When we put up the real wall, we're going to stop 99 percent. Maybe more than that."

Trump's visit was greeted with peaceful protests by demonstrators both for and against his planned wall. The trip came amid an escalating battle between his administration and the liberal state, which has refused to help federal agents detain immigrants in the U.S. illegally.

The president renewed his criticism of Democratic Gov. Jerry Brown, saying Tuesday that he was presiding over sky-high tax rates and that the state's sanctuary policies "put the entire nation at risk."

"They're the best friend of the criminal," Trump said. "That's what exactly is happening. The criminals take refuge in these sanctuary cities and it's very dangerous for our police and enforcement folks."

The Justice Department last week sued to block a trio of California laws designed to protect people living in the U.S. illegally. Brown accused U.S. Attorney General Jeff Sessions of "going to war" with California to appease Trump.

After leaving the border, Trump basked in the cheers of U.S. Marines in Miramar, pointing to his work to build up the nation's military. He also suggested there may someday be a "space force" fighting alongside the nation's military branches.

Referencing his 2016 campaign showdown against Hillary Clinton - she received 4 million more votes than Trump in California - the president vowed that "very soon we're going to Mars" and the nation would not be seeking to explore the red planet had his opponent won.

Trump later attended a high-dollar fundraiser near Los Angeles, where he was staying overnight. Guests paid up to $250,000 to attend the event at the Beverly Hills home of Ed Glazer, co-chairman of the Tampa Bay Buccaneers. The money raised will go to a joint fundraising committee that benefits Trump's 2020 re-election campaign and the Republican National Committee.

A few hundred protesters for and against Trump faced off at a Beverly Hills park. A group of pro-immigration demonstrators chanted, "Say it now, say it clear, immigrants are welcome here."

Demonstrations were also held at the San Ysidro port of entry in San Diego, the nation's busiest border crossing, where protesters chanted, "No ban! No wall!" as honking cars and buses cheered them on. Protests were also held on the Mexican side, in Tijuana.

At San Ysidro, Jose Gonzalez, 21, stopped to snap a photo of the protesters holding signs, including one that read: "Wall off Putin!" in reference to Russian President Vladimir Putin, who has a seemingly close relationship with Trump.

"I don't think it's really fair how he has the choice to separate us," said Gonzalez, a dual citizen who lives in Tijuana and crosses the border daily to work at a San Diego ramen restaurant.

Army veteran Mark Prieto, 48, shook his head as he walked by the protest.

"People are so narrow-minded," the Riverside firefighter said as the crowd chanted. "Finally we have someone who is putting America first."

His wife, Corina Prieto, a nurse who has extended family in Mexico, agreed. Both voted for Trump.

"I think he is doing a lot of good, like protecting our Border Patrol," she said.

Carla Provost, acting Border Patrol chief, said Trump "walked away with great understanding of the requirements we have on the border." She and other agents briefed the president on beefed-up security in California, Arizona and Texas over the years and cautioned that any changes need to preserve the ability to see what's happening on the other side. Provost said Congress has so far funded 40 miles of replacement wall - 14 miles in San Diego, 2 miles in Calexico, California, and 24 miles in El Paso, Texas.

Trump is seeking $25 billion from Congress to extend the wall but Democratic leaders have balked. His insistence that Mexico pay has gotten no traction.

San Diego's Republican mayor criticized Trump's short visit, saying the president wouldn't get a full picture of the city. Kevin Faulconer said a popular cross-border airport terminal connecting San Diego and Tijuana shows that "building bridges has worked wonders."

Faulconer, writing in The San Diego Union-Tribune, also said San Diego police work to protect everyone regardless of immigration status, an apparent dig at Trump's push to target illegal immigration.

Trump tweeted about California's immigration policies as he flew to the state aboard Air Force One.

"California's sanctuary policies are illegal and unconstitutional and put the safety and security of our entire nation at risk. Thousands of dangerous & violent criminal aliens are released as a result of sanctuary policies, set free to prey on innocent Americans. THIS MUST STOP!" he wrote.

This isn't Trump's first visit to the border. He traveled to Laredo - one of Texas' safest cities - weeks after declaring his candidacy in June 2015.

Trump told reporters then that he was putting himself "in great danger" by coming to the border. But, he said, "I have to do it. I love this country."

---

Associated Press writers Kathleen Ronayne in Sacramento, John Antczak and Christopher Weber in Los Angeles, Elliot Spagat in San Diego, Greg Bull in Tijuana, Mexico, and Darlene Superville, Ken Thomas and Nancy Benac in Washington contributed to this report.