Border wall protesters and supporters greet Trump in California

President Donald Trump visits prototypes for his proposed U.S.-Mexico border wall near San Diego, Calif., Tuesday, as a few hundred peaceful of protesters and supporters line the street and police stand by.

Peaceful pro- and anti-Trump demonstrators line up on opposite sides of the streets as police stand by

Lauren Rees holds up a sign as part a rally against a U.S.-Mexico border wall as President Donald Trump was set to visit San Diego, Calif., on Tuesday. Protesters chanted, 'No ban! No wall!' (Kyusung Gong/Associated Press)

Dozens of pro- and anti-Trump demonstrators gathered on opposite sides of the street Tuesday as President Donald Trump's motorcade entered a restricted area in the outskirts of San Diego, Calif., so he could see prototypes of his proposed border wall with Mexico.

The two sides were separated by a heavy presence of police officers in helmets and riot gear, but the rallies were peaceful. Demonstrators on each side carried signs and shouted.

Several dozen people along the motorcade route took photos. One hoisted a Trump flag and others raised middle fingers.

Earlier, about 250 Trump supporters rallied near San Diego's Otay Mesa border crossing. And about 100 Trump opponents gathered at San Diego's San Ysidro border crossing. 

Protesters chanted, "No ban! No wall!" near the San Ysidro crossing, where tens of thousands of people enter the U.S. daily from Tijuana, Mexico, many on their way to work or school in San Diego. Drivers honked as a show of support.

Pro- and anti-Trump demonstrations were planned later in the day in Los Angeles for the president's arrival there.

Trump's first visit to California

Other protests were planned later in Tijuana and San Diego to mark Trump's first presidential visit to California, where he examined eight nine-metre-tall prototypes built last year along the border in a bid to fulfil his signature campaign promise.

Trump has long said he wanted to visit the models himself so he can pick a winner, though the Department of Homeland Security says elements of each design are expected to be used.

The president appeared engaged as he was briefed the wall designs. He said he preferred a fully concrete wall because it was the hardest to climb, but he noted that it needed to be transparent.

Trump reviews border wall prototypes on Tuesday in the outskirts of San Diego. (Evan Vucci/Associated Press)

Trump said the first thing he noticed on the drive to view the prototypes was the patched-up holes in part of the existing fence at the border.

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

The president said Tuesday that the state's sanctuary policies "put the entire nation at risk." His Justice Department sued California last week over a trio of the state's immigration laws.

"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." 

On Twitter, Trump said the wall will pay for itself, a shift from his oft-repeated statements during his 2016 presidential campaign that Mexico would pay.

The president was also expected to speak Tuesday with immigration enforcement officials and with marines at Marine Corps Air Station Miramar before heading to a fundraiser in Los Angeles.

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 that if Trump stayed more than a few hours, he would see that a strong economy and free trade aren't a contradiction but a way of life.

The mayor, a business-friendly Republican and ardent supporter of the North American Free Trade Agreement, said a popular cross-border airport terminal connecting San Diego and Tijuana shows that "building bridges has worked wonders." The terminal is a few miles from the border-wall prototypes.

Trump had campaigned against NAFTA as a job killer that he said encouraged American companies to move factories to Mexico to exploit cheap labour. Renegotiation of the deal began last summer.

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.

The issue has led to heightened tensions between California and the Trump administration. The Justice Department recently sued over state laws that limit co-operation with immigration authorities, which state officials have harshly criticized.

San Diego's city council last year passed a resolution opposing Trump's proposed wall.

Supporters and protesters talk as they wait for Trump to arrive in San Diego on a visit Tuesday to view border wall prototypes. (Mike Blake/Reuters)

Jeff Schwilk, founder of San Diegans for Secure Borders, whose group participated in a rally in December near the prototypes that ended in clashes with counter-protesters, said the council's resolution does not reflect the views of many residents who feel the border is not secure.

"We absolutely want President Trump to feel welcome and to come inspect the prototypes so we can get the wall built."

With files from CBC News