Los Angeles Mayor Eric Garcetti is in a tough spot.

An outspoken critic of Donald Trump throughout the campaign, he's now trying to figure out how to maintain his city's policy as a sanctuary city on immigration without losing the $500 million Los Angeles gets from the federal government. At TechFair LA, where the city hosted over 13,000 job-seekers and more than 275 tech companies on Thursday, Garcetti explained to CNBC how he's willing to stand up to the new president.

Garcetti says he's confident that the city won't lose its funding, and if it does, he's willing to take legal action. "I think we're on very secure ground as the U.S. Constitution says you can't put a federal financial gun to the heads of states and tell them what to do in exchange for funding," he said.

"We also feel that the ethical argument and the practical argument are on our side. In these cities that are open to more immigrants we have lower crime rates, we have more economic prosperity, lower unemployment rates, so we feel like this will hold up in court," he said

Garcetti stressed that the city doesn't refuse to cooperate with federal officials. "We just require that there be a constitutional court warrant, that we don't pull somebody over by the way that they look or ask their immigration status when they come to be a witness in a crime."

Trump and the Democratic Garcetti have spoken about protecting immigrants and keeping immigrant families together. Despite Trump being adamant that cracking down on illegal immigration is a top priority, Garcetti said he thinks the president is keeping a "very open mind."

"We wanted to fix a large system that he also acknowledged was broken. So there's room for common ground," Garcetti said. "But it's really a nonideological issue. Here in LA, 61 percent of our new businesses on our main streets are started by immigrants. … I think as long as we tell those stories about why our boom is linked to immigrants, we can change hearts and minds."

A key piece of the Los Angeles economy: its massive port, which faces a huge threat if Trump follows through on his promise to fund wall on the Mexican border with a 20 percent tax, and if a trade war erupts with China. "One out of every nine jobs depends on the port of Los Angeles and the port of Long Beach here in the LA region," said Garcetti.

Garcetti's hopes that Trump could eventually embrace his approach to immigration and trade stands in sharp contrast to the mayor's criticism of the candidate on the campaign trail. Garcetti has called Trump "a racist, a bigot and a sexist," and "the walking embodiment of the worst of our values."

Now, Garcetti says he has an obligation to work with any administration, and he's going to do his best to do just that while also standing by his values.



"I'm not going to back off the beliefs I have and that this city holds and embodies," Garcetti said. "But instead of seeking to divide a very strong social fabric here, we're going to continue to unite it, and hopefully we can welcome the president in doing that in the future."