President Trump slammed Los Angeles Mayor Eric Garcetti over his immigration policies Tuesday as he was preparing to visit the area for a fundraiser and to meet with organizers of the 2028 Olympic Games.

The criticism was in response to a Friday tweet from Garcetti informing undocumented immigrants of their rights and reiterating that the Los Angeles Police Department does not cooperate with U.S. Immigration and Customs Enforcement (ICE).

"The Mayor’s efforts to shield illegal aliens endangers the lives of the public and law enforcement who have to go into the field to apprehend those released," Trump posted. "He shouldn’t be urging illegals to beat the system, he should be urging them to safely turn themselves in!"

BRANDON JUDD: SANCTUARY CITIES LIKE LOS ANGELES SENDING 'WRONG MESSAGE' BY NOT COOPERATING WITH ICE

Trump has excoriated California in the past for its massive homeless population, wildfires and sanctuary city policies, where local law enforcement agencies are prohibited from cooperating with federal immigration authorities.

Specifically, they refuse to honor detainer requests that ICE be notified when a jailed undocumented immigrant is released so they can be taken into federal custody to begin deportation proceedings.

In his State of the Union address, Trump blasted the practice and has threatened to withhold federal funding to the state, which has been challenged in court.

In a speech to the National Border Patrol Council last week, he brought up on stage the granddaughter of Maria Fuertes, a 92-year-old legal immigrant who was sexually assaulted and killed by an undocumented immigrant in New York City last month.

The suspect was released from custody several months prior despite an ICE detainer request.

“The tragedy in all of this is the fact that this could have been avoided, had there been no sanctuary law," granddaughter Daria Ortiz tearfully told the audience.

Garcetti, a Democrat, has repeatedly defended his stance of being supportive of immigrants.

“Regardless of your immigration status, I want every Angeleno to know your city is on your side. Here in Los Angeles, our police department does not coordinate with ICE or participate in immigration enforcement,” Garcetti said on Twitter.

In an effort to bolster resources in sanctuary cities, the Trump administration will deploy 100 members of an elite Border Patrol unit to some areas to make arrests and removals.

CLICK HERE TO GET THE FOX NEWS APP

In Los Angeles, Trump is expected to receive an update on the preparations for the 2028 Summer Olympics to be hosted there before heading to Beverly Hills for a fundraiser. On Wednesday, he is scheduled to meet with House Minority Leader Keven McCarthy, R-Calif., to discuss agricultural issues in Bakersfield.

He will also visit Arizona, Colorado and Nevada.

Fox News' Adam Shaw contributed to this report.