Libby Schaaf’s first term as mayor of Oakland saw some of the most trying events in recent city history — among them, the deadly Ghost Ship fire in 2016 and a sexual misconduct scandal at the Police Department.

Add to that a growing homelessness crisis, skyrocketing housing prices and a high-end building boom that have upended life in the city for many, and Schaaf’s re-election might look endangered. But while she has plenty of challengers — nine are running against her, mostly from the left — none has emerged as a serious threat.

It’s somewhat unfamiliar political territory for a city that in recent elections has seen hard-fought battles for the top job. Schaaf, who famously sparred with President Trump over her disclosure of an impending federal immigration raid in the city, deserves some but not all of the credit for this, political observers said.

“If someone lived in Oakland, you’d hardly know there’s a mayor’s race,” said Jim Ross, an Oakland political consultant who follows city politics and is not working with any mayoral campaign. “I don’t even think there’s a mayor’s race for all intents and purposes. ... Most people think Libby Schaaf should and will get re-elected. But that doesn’t fully reflect the profound disappointment in the direction of the city that a lot of people feel.”

If Schaaf prevails in November, she would be the first incumbent mayor to win re-election since Jerry Brown clinched his second term as the city’s lead executive 16 years ago. The continuity inside City Hall would be a marked difference from surrounding neighborhoods, where construction cranes and high-rises are taking their place in the new skyline as fast as flourishing homeless encampments fill the streets.

Five of Schaaf’s challengers are perennial candidates or lacking visible campaign operations. None has previously held public office.

The four who have raised funds, door knocked and debated Schaaf at town halls are Cat Brooks, a nonprofit manager and activist; Pamela Price, a civil rights attorney defeated in the June Alameda County district attorney’s race; Saied Karamooz, a businessman and city commissioner; and Marchon Tatmon, who has worked in the nonprofit and finance worlds.

Schaaf and her campaign staff say they take the competition seriously. She said the race is an opportunity to re-engage residents, tell them what their city government has been doing and correct misconceptions, which she said are rampant, especially in forums with the other candidates.

“I never take anything for granted,” Schaaf said. “I don’t think any incumbent can ever take re-election for granted or assume that it’s a foregone conclusion, particularly in an activist city like Oakland. There’s always a demand for change, for more radical ideas.”

For Schaaf, who served one term on the City Council prior to her 2014 mayoral victory, this is her first race as an incumbent seeking re-election.

Schaaf’s battle with Trump, U.S. Attorney General Jeff Sessions and conservative media, in response to her public warning about an immigration enforcement operation in February, elevated her national profile from that of a mostly unknown local politician to a leader of the anti-Trump “resistance.”

She said the attention and ensuing tit-for-tat with the White House were unexpected and that she’s since been trying to focus on city and regional problems. For weeks, Trump and his administration officials called Schaaf “a disgrace,” compared her to a “gang lookout” and said she should be prosecuted for obstruction of justice.

“I definitely knew that it was risky. I knew that a lot of people would be deeply offended,” she said. “I had no idea that the president would notice what I did and, frankly, obsess about it.”

Many political watchers noted that being on the receiving end of a Trump attack is a dream of any California Democrat.

Schaaf’s challengers have mostly framed themselves as to the left of the mayor. Some, like Brooks, have promised to end homelessness in the city within 100 days of being inaugurated through using city-owned land and buildings to house anyone who seeks shelter.

Brooks, best known for leading street protests with the Anti Police-Terror Project, said the outcome in November will define the character and legacy of the city for generations.

“This election will be very telling about the direction of Oakland’s politics,” Brooks said. “If (Schaaf) wins, we’re San Francisco 2.0 at the end of the four years.”

Price pointed to the precinct-level results from the district attorney’s race, which showed her leading incumbent Nancy O’Malley in Oakland’s flatlands, as proof of the viability of her campaign.

“The message that we brought to Oakland resonated,” she said. “Oakland voters want change. Oakland voters are tired of police misconduct and a lack of accountability. Oakland voters want public officials who are transparent and willing to work with the community.”

Supporters of Brooks and Price contend the two are in the mold of ultra-progressive candidates who have defeated establishment incumbents in attention-grabbing Democratic congressional primary upsets this year, like Alexandria Ocasio-Cortez in New York City and Ayanna Pressley in Boston. They hope that a tide of Democratic enthusiasm and displeasure with the status quo will be enough to launch one into the mayor’s office.

One factor on their side is ranked-choice voting, in which ballot-casters select up to three preferred candidates. If no one receives a majority of votes among No. 1 picks, then the candidate who received the fewest first-choice votes is taken out of the running, and their votes are redistributed to the No. 2 choices on those ballots. The process continues until someone gets a majority.

Teaming up against the favorite — an anyone-but-Schaaf strategy promoted by Brooks and Price — saw success in the 2010 Oakland mayor’s race when Jean Quan and City Councilwoman Rebecca Kaplan used it to defeat Don Perata, who got a plurality of first-round votes but lost to Quan after ranked-choice redistribution.

Ross, the political consultant, said many of Oakland’s troubles are not Schaaf’s fault. Problems around homelessness and housing affordability, for instance, are vexing the entire region, he said.

“I think that her response has been a little late and a little slow, but it’s been getting some traction,” Ross said. “I also think people are willing to give local elected officials a bit of a break on the housing issue because they have limited tools to fix it.”

But Ross said Schaaf and her administration are on the hook for certain quality-of-life and city-services issues, such as illegal dumping, which unites neighborhoods across the city in frustration.

Karamooz, a member of the Oakland Coalition for Police Accountability and Privacy Advisory Commission, said beautifying the city would be among his priorities as mayor.

“I challenge any Oaklander to find one pathway through our city where they would be proud to take an out-of-town guest,” he said. “Not one exists. Each one will be filled with illegal dumping, tagging and encampments.”

Oakland’s most entrenched, complex problems — like balancing the budget and addressing unfunded pension liabilities — are “not for newcomers,” Schaaf said. She sparred, sometimes bitterly, with the city’s unions last year, saying Oakland couldn’t afford the pay raises they wanted. Workers went on a weeklong strike.

Ross said Schaaf’s relative fiscal prudence compared with that of her predecessors could position her for a more aggressive second term.

“It gives her a real opportunity to define and put a stamp on the city of Oakland,” he said. “It’s also likely in her second term she’ll face an economic downturn. How she deals with that will be defining.”

Kimberly Veklerov is a San Francisco Chronicle staff writer. Email: kveklerov@sfchronicle.com Twitter: @kveklerov