But not all of the shift can be explained by newly elected Democrats. Michael Gianaris, the New York Senate deputy majority leader who represents western Queens, raised eyebrows in local political circles when he backed Sanders this year after endorsing Clinton in 2016.

“The election of Donald Trump changed everything for a lot of us,” he said. “The best way to defeat a troublesome zealot like that is to make the strongest case for dramatic change, and I think Bernie Sanders does that.”

In Philadelphia, Kenney, who began his political career as a moderate, has fully embraced the progressive agenda in recent years, making it unlikely that he would have endorsed a centrist. The left is so energized here that even Krasner, a progressive darling across the nation, faced backlash from Sanders supporters in the city after he sided with Warren.

“You’re watching an election cycle in which presidential candidates have reason to want the endorsements of big-city progressive D.A.s because they’re having to answer questions at debates like, ‘Do you think people who are actually incarcerated should vote?'” said Krasner. “That’s not even a question you would have heard eight years ago."

The lack of a dominant establishment frontrunner in the primary also means there is little political debt to pay off for some city officials — and more room to support a progressive if they so wish. In 2016, New York City Mayor Bill de Blasio backed Clinton, whose first Senate campaign he managed, though, to her team’s chagrin, he couldn’t help but speak positively about Sanders. De Blasio has yet to endorse a candidate after dropping out of the presidential race himself in September, but “his heart is very much with Bernie and Warren,” according to a former aide.

The shifting political climate has, to some degree, created a new class of powerbrokers. Before he announced that he was backing Warren, Krasner said six presidential contenders contacted him in person or over the phone. While she was courting the Working Families Party, Warren threw her weight behind a long-shot, left-wing Philadelphia council candidate, Kendra Brooks, who was bucking the entrenched local Democratic Party and running on the group’s ticket. (Brooks won in November.) Sanders has visited the city to protest the closure of a hospital and attend a summit held by the Philadelphia AFL-CIO.

“Elizabeth Warren and Bernie Sanders have been very willing to involve themselves in local issues. That’s unusual,” said Larry Ceisler, a longtime Philadelphia political observer working in public relations. “In past elections, it was only the mayor who presidential candidates would call and say, ‘How about an endorsement?’”

Chicago Mayor Lori Lightfoot. | Scott Olson/Getty Images

Democratic operatives and elected officials in Philly said Warren’s aides in particular have made an aggressive play for endorsements. “They courted me more than any other campaign,” said Isaiah Thomas, one of the soon-to-be council members backing Warren. “They called me. They met with me. We talked about issues. They gave me the opportunities to communicate my opinion.”

While there has been a steady shift to the left in many cities, moderate Democrats are far from dead in them: In Philadelphia, U.S. Reps. Dwight Evans and Brendan Boyle both gave nods to Joe Biden, who has close ties to Philadelphia. Chicago Mayor Lori Lightfoot, who hasn’t endorsed a presidential candidate yet, isn’t typically swayed by the left wing of the Democratic Party — as the progressives on the city council can attest. She has butted heads with them since she took office in a landslide earlier this year.

“Mayor Lightfoot has proved to be the opposite of a politician who makes a move based on which way the wind blows,” said Chicago-based campaign veteran and communications consultant Becky Carroll, who worked on Barack Obama and Al Gore’s campaigns.

Los Angeles Mayor Eric Garcetti, who backed Clinton in the 2016 primary and looked hard at a presidential bid himself in 2020, has not yet endorsed a candidate. In December, he flew to Iowa to participate in a forum he helped put together in which mayors interviewed some of the presidential contenders. He has personal relationships with several of them, according to his aides.

“He’s a friend of Mayor Buttigieg’s. He and Cory Booker were Rhodes Scholars together. He’s done a lot of things with Mayor Bloomberg, and has a great relationship with Vice President Biden,” said Bill Carrick, a political consultant for Garcetti.

A Garcetti adviser said he has also met privately with Sanders — “had a really good meeting, in fact” — and Warren. The person said he will likely endorse a candidate before Super Tuesday, when California goes to the polls.

In this era, progressives are bullish on their chances of winning over more urban politicos like him — and hopeful of putting an end to the practice of transactional presidential endorsements.

“The reason big-city elected officials are backing progressives is because when you are in a large city, you realize the incredible need for massive government solutions,” said Monica Klein, a New York City-based progressive consultant. “You need a police department with 37,000 officers. You need a million tons of salt when it snows.”

Shia Kapos contributed to this report.

