The mayor, who won 70% of the vote for her own re-election Tuesday, opposed Preston and Boudin and campaigned heavily for their opponents, incumbent Supervisor Vallie Brown and interim incumbent Suzy Loftus for district attorney, both of whom Breed appointed. But, in the end, both men claimed narrow victories Saturday evening: Preston edged out Brown by 188 votes in the ranked-choice count, while Boudin came out 2,825 votes ahead of Loftus.

Brown had yet to concede by Sunday afternoon. Her campaign consultant, Leo Wallach, said her team is waiting until “everything is resolved” with the vote counts.

Still, the outcomes of the District Five and district attorney races were bruising for the mayor.

Breed will now enter a four-year term with one less ally on the Board of Supervisors and a district attorney who will probably have a much more liberal approach to street-level crime — such as drug dealing and car break-ins — than she does.

Breed was not available for comment Sunday. Her spokesman, Jeff Cretan, said the mayor is willing to compromise with anyone, even those she may not immediately see eye to eye with.

SF District Attorney candidate Chesa Boudin speaks during election night party at SOMA StrEat Food Park in San Francisco, Calif., on Tuesday, November 5, 2019.

Photo: Scott Strazzante / The Chronicle 2019

For example, the mayor currently has a competing March ballot measure with two supervisors on mental health reform, but Cretan said both sides are currently hashing out a compromise. Also, after initially having different visions on the two affordable housing proposals, the mayor and supervisors came together to support both measures Tuesday.

“The mayor has demonstrated the ability to work with everyone on the board and in City Hall on different issues, including people who she didn’t support in previous elections,” he said.

While Breed has created inroads with nearly every supervisor at some point during her tenure, she also has run into challenges with progressive supervisors. Preston, a tenants’ rights attorney and a democratic socialist, will bolster the already progressive-leaning board.

Brown was seen as one of Breed’s few allies on the 11-member board. But Preston — who ran against Breed in 2016 for her supervisor seat and narrowly lost — will probably be more of an adversary for the mayor.

“The election results are mandates for change and a statement by voters that they want bolder action from City Hall,” Preston said in a phone interview from Florida, where he was traveling with his family. “It was an issue for voters to have someone who is independent from the mayor.”

An even more progressive board will make it more difficult for Breed to drive her agenda on key priorities, such as homelessness and housing.

“When you get a strong opponent on the Board of Supervisors, then (the mayor) is reacting to the board rather than driving their own policies,” said Jim Ross, a political consultant. “When you can get the board and the mayor working collaboratively, you can really address and solve problems. But there needs to be pressure on both parties to address those problems.”

District Five candidate Dean Preston listens to speakers at a campaign watch party at Noir Lounge in Hayes Valley.

Photo: Kate Munsch / Special to The Chronicle

Preston said he will push for high levels of affordable housing and is less amenable to the idea of mixing market-rate and affordable housing than Breed. One of his biggest campaign promises was to build 10,000 units of 100% affordable housing within 10 years. He also wants to propose a ballot measure next year that would slash the price of Muni and eventually make it free for all.

“In San Francisco, his policies and proposals are widely accepted by voters across the city,” said James Taylor, a political science professor at the University of San Francisco. “I would think that Dean Preston would advocate for policy positions on the local level that are akin to what Bernie Sanders and Alexandria Ocasio-Cortez are at the federal level.”

While Preston’s supporters appreciate his ambition, his critics say that some of his proposals — like the 10,000 units of 100% affordable housing — would be prohibitively expensive.

Boudin promised to confront mass incarceration and racial disparities in the criminal justice system and also pledged to hold police more accountable in cases of brutality. He also promised to stop prosecuting many low-level crimes, such as petty drug possession. While his progressive approach won approval from voters, if issues in San Francisco — such as property crime and open-air drug use — don’t noticeably improve, it is Breed who will probably catch the most heat from residents.

Breed supported Loftus because she wanted a district attorney she could “work with” to accomplish her agenda. The mayor was slammed for her decision to appoint Loftus to interim district attorney in early October and was accused of trying to meddle in the election. While it is hard to say for sure how much the appointment hurt Loftus in the final stretch of the campaign, Taylor said it may have backfired and cost her some votes.

Boudin said he is looking forward to finding common ground with the mayor and “expanding that whenever possible.”

“The mayor has a critical role to play in this city, and I also think the independence that I bring is going to be critical to the interaction between the different branches,” Boudin told The Chronicle.

Taylor said he expects creative policies from Boudin around sanctuary cities and police use of force and accountability.

District Attorney-elect Chesa Boudin greets supporters during his election night party at SOMA StrEat Food Park.

Photo: Scott Strazzante / The Chronicle

“You’ll see a lot of experimental-type proposals,” he said. “Clearly voters want some kind of change in the issue of criminal justice reform. Even though they voted for the progressive, they want to see everyday problems that San Franciscans know about addressed” like car break-ins and drug dealing.

But, he said, while Preston and Boudin ran on platforms of disrupting the status quo, they may be in for a shock when they take office.

“It’s one thing to be on the outside calling for revolution and change,” he said. “But now they are part of the system, and they have to play the game.”

Meanwhile, Matt Haney, a progressive supervisor who endorsed both Preston and Boudin, called the election results a turning point for San Francisco.

“The voters are demanding that we bring new ideas and energy to the city’s problems,” he said. “They sent a clear message with these results. City Hall should be on notice.”

Trisha Thadani is a City Hall reporter for The San Francisco Chronicle. She previously covered work-based immigration and local startups for the paper’s business section.

Thadani graduated from Boston University with a degree in journalism. Before joining The Chronicle, she held internships at The Boston Globe, USA Today, The Wall Street Journal, and was a Statehouse correspondent for the Worcester Telegram & Gazette.