Last week, President Donald Trump lashed out on Twitter after a California judge blocked his sanctuary city executive order. The order had threatened to defund cities that don't cooperate with federal immigration enforcement.

The move marks yet another judicial blow to Trump and thrusts back into the spotlight the role that not only judges but also cities and local officials will play in responding to Trump's immigration agenda.

One man who's been at the center of the sanctuary cities debate is Eric Garcetti, the popular Los Angeles mayor who recently won reelection for his second term.

"We will defend any undocumented worker who's going to be deported," he said flatly in a recent interview. The words are backed up in deed: In December, Los Angeles unveiled an ambitious $10-million fund to provide legal counsel to residents facing deportation.

Garcetti, who was elected in March with more than 80% of the vote, is young, charming, a darling of Hollywood and the city's growing tech community and a fast-rising star in the Democratic party who is often touted as a possible 2020 presidential contender. He's also quietly emerged as one of America's leading voices in the liberal fight against Trump.

Angelenos will not back down in the face of hate. We will stand up to injustice &amp; protect our most vulnerable. #MayDay2017

I recently sat down with Garcetti at his Los Angeles office ahead of his reelection to discuss how he views his role in the Trump era. Much of our conversation revolved around the 46-year-old mayor's plan to respond to Trump's immigration agenda.

Immigration is something of a touchy subject for Garcetti, who's taken heat from progressive activists for failing to officially declare Los Angeles as a sanctuary city. The critique isn't quite fair. Garcetti, who proudly calls himself Mexican-American and Jewish Italian, is a vocal advocate for immigrants and recently attended the demonstrations at Los Angeles International Airport to show solidarity with protesters against Trump's proposed travel ban.

"It was important to be there and embrace the first guy ordered back after he was refused entry," Garcetti told me.

Still, unlike his Chicago counterpart Rahm Emanuel, who has repeatedly said that "Chicago will always be a sanctuary city," Garcetti stops short of using the term. He chalks this up to a matter of legal technicality. "It's a confusing term to people," Garcetti said. "In a legal sense, we're not one and we've never declared ourselves to be one. But I think we are a sanctuary. We go further. We're a city of defense, of action. We're a constitutional city."

That sentiment has done little to assuage progressive activists, however, who recently organized protests outside of Garcetti's reelection party. The activists called for him to take a harder stance against Trump on immigration and adopt the sanctuary city label.

This all may seem like semantics, but Garcetti's nuanced immigration position seems to speak more broadly to the type of Democratic leader he ultimately aspires to be. Garcetti has opted for a more pragmatic approach to governance, unlike some of his liberal California counterparts who have taken more absolutist and hardline positions in the Trump era — firebrand liberals like Rep. Maxine Waters, for instance.

Garcetti himself bristles at the characterization. "I push back a little because I don't want to turn into the caricature of pragmatism or tone," he said. "It is not like, 'Hey, let's find a compromise every time.'"

But he won't reject compromise — or even cooperation with the Trump administration — either. Garcetti says he is prepared to work with the Trump administration on matters that stand to benefit Los Angeles, such as infrastructure and transportation projects.

"I'll work with this administration on anything that reflects our interests and values," Garcetti said. "I'm not any less hardline in terms of standing up for the things we believe in. But I think we have an obligation to bring tax dollars back to Los Angeles, help reduce traffic, to repatriate our tax dollars from D.C."

That position makes sense when viewed through the prism of Garcetti's ambitious second term agenda. During his first term, Los Angeles voters passed Measure M, a small sales tax increase to fund billions of dollars in transportation projects across the city. Before he left office, President Barack Obama, who is a friend of Garcetti's, also earmarked $500 million for railway projects across the city — one of several large federal funding allocations directed toward Los Angeles during Garcetti's tenure. There's quite a bit riding on Garcetti's relationship with the Trump administration as a result.

However, Garcetti's pragmatic approach has not come without critics, who sometimes say he can be averse to controversy — or worse, spineless in the face of the challenge posed to progressive values by Trump. When I asked Garcetti how he responds to those who say he's too soft on Trump, he admitted he listens to the critique, but also pushed back. "I've come to learn if you don't bloody someone's nose, people think that you're not getting things done, when those bloody noses don't result in much," he said.

That positioning has clearly served Garcetti well as mayor; he soared to reelection with a record margin of the vote and his name is frequently thrown around in conversations about the 2018 California governor's race, as well as future presidential elections.

Whether this approach will serve Garcetti should he choose to run on a bigger stage remains to be seen.

As Sen. Bernie Sanders (I-Vt.) and Tom Perez's recent unity tour exposed, there remains a wide rift on the left which boils down to how far Democrats will move to embrace the party's left wing. While other potential 2020 contenders like Sen. Kirsten Gillibrand (D-N.Y) have moved closer in that direction since Trump's victory, Garcetti seems steadfast in his commitment to lean more toward the middle.

"There's no such thing as red states and blue states," Garcetti told me, citing the famous line from Obama's 2004 convention speech. "I don't write off 20% of my city because they are Republicans. I work with them every day."

While that means Garcetti is unlikely to become a firebrand mayor who will oppose Trump at every turn, he made clear that he's no less committed to responding to Trump's election with action. Garcetti believes the 2016 election could serve as a catalyst that ushers in a wave of change across the country.

"If this mobilizes an army, it's going to be one of those hinges of history," Garcetti said. "This is going to be one of those organizing moments. Everyone keeps saying it's unfortunate it took this. I don't buy that line, I just think it's good to have people working on it."