President Donald Trump's deployment of the National Guard to Los Angeles in response to immigration protests follows a long history of U.S. elected officials sending troops in hopes of thwarting unrest connected to race-related clashes between residents or residents and local law enforcement.

National Guard troops are typically deployed for a variety of emergencies and natural disasters with the permission of governors in responding states, but Trump, a Republican, sent at least 300 California National Guard troops to Los Angeles despite the objections of California Gov. Gavin Newsom and Los Angeles Mayor Karen Bass, both Democrats.

Trump said that federalizing the troops on Saturday was necessary to “address the lawlessness” in California. The Democratic governor said Trump’s recent decision was “purposely inflammatory and will only escalate tensions.”

Los Angeles Mayor Karen Bass pushed back on the deployment on Monday, saying nothing was happening in the city before the raids started.

“It was very clear that if raids happened here, the community was going to respond in a very negative way," she said. “I was very hopeful that the federal government would not have deployed the National Guard."

Confrontations began when dozens of protesters gathered outside a federal detention center, demanding the release of more than 40 people arrested by federal immigration authorities across Los Angeles on Friday, as part of Trump’s mass deportation campaign.

Bass said all of that creates fear and tension in the city, and this was a buildup,” she said. “Our city was peaceful before the raids took place."

Bass said she blames the people that were creating the violence and that what happened in Los Angeles Sunday night was absolutely unacceptable.

"I really think we need to go back and look at norms and look at what policies and laws actually are, because I think the thing that is challenging in this administration is that you don’t know where the line is. So if you’re going to say that this is exactly why we need the National Guard, again I’m going to go back to Thursday," she said.

Some of the previous National Guard deployments have preserved peace amid intensified protests or vigilantes threats, but sometimes they have flared tensions among people who were protesting for civil rights or racial equality.

Presidents have sometimes invoked an 18th-century wartime law called the Insurrection Act, which is the main legal mechanism that a president can use to activate the military or National Guard during times of rebellion or unrest. Other times they relied on a similar federal law that allows the president to federalize National Guard troops under certain circumstances, which is what Trump did on Saturday.