Halfway through her four-year term as Oakland’s mayor, Libby Schaaf faced a crushing tragedy that forced her to reconcile the underground arts scene she has long supported with the promise of public safety that helped her win office.

The Dec. 2 Ghost Ship fire that killed 36 people at a non-permitted event and warehouse in the Fruitvale district not only spotlighted the warehouse culture that has helped fuel Oakland’s revival, but pressured Schaaf to take a critical look at the rampant safety deficiencies that contributed to the horror that night. Yet as other cities throughout the country rushed to inspect, red-tag and shut down similarly non-permitted artist warehouses in the wake of Ghost Ship, Schaaf has taken a different tack.

The mayor so far has approached the Ghost Ship fire, and its aftermath, in the same circumspect way that she dealt with other high-stakes issues. During two years in office, she has tried to delicately balance the demands of developers and housing activists, protesters and downtown businesses, Raiders fans who want a new stadium and taxpayers who don’t want to prop up a football team.

“Welcome to my life,” Schaaf said with a tense laugh Friday. She said her job during each of these flareups is to “choose a path that maximizes both interests,” even if it angers a lot of people in the short term.

The Ghost Ship fire — the worst structural blaze in the U.S. in more than a decade — raised new questions about Oakland’s handling of industrial buildings that are illegally turned into residences, and of the parties that often lure dozens of revelers into such spaces. Schaaf, who spent the first week after the blaze consoling bereaved families and facing omnipresent TV cameras, struggled to convince her constituents that city officials weren’t at fault, that safety measures would improve, and that her administration wouldn’t use the Ghost Ship as an excuse to shut down underground artist warehouses.

Despite these reassurances, Schaaf quickly found herself at the center of a maelstrom. Representatives of the firefighters’ union blamed dysfunction in their department, which just last week hired a temporary assistant sworn fire marshal after the position had been open for five years. City Councilman Noel Gallo, who lives one block from the Ghost Ship and said he knew long before it burned down that people were holding illegal parties there, rebuked the city for not conducting inspections. Councilwoman Rebecca Kaplan chided Schaaf’s administration for failing to fill key vacancies — besides lacking an assistant sworn fire marshal, Oakland has no head of Planning and Building. Artists heckled Schaaf on social media and accused her of failing to shield them from an impending crackdown.

“It’s impossible to overstate how hard the job of the Oakland mayor is,” said former City Council President Pat Kernighan, who commended Schaaf for confronting a horrific disaster without getting bogged down in political gamesmanship.

Others are frustrated by the mayor’s refusal to instigate what she has called “witch hunts” of artist buildings, or to chasten any city department or employee after the fire.

“When I first read the phrase ‘We aren’t doing witch hunts’ in a newspaper article, I wrote a response saying ‘These are not witch hunts, this is to protect human life,’” said Greg McConnell, head of the nonprofit Jobs and Housing Coalition, which lobbies for Oakland developers and business interests.

“We need to find out where the system failed,” he added, “and we need to correct it so this doesn’t happen again.”

Rather than talking tough on building inspections and event permits, Schaaf has made compassion for artists her top priority.

She told The Chronicle she will release an executive order this week that “very clearly articulates our values.” It will direct city staff to “do our duty with regard to ensuring safe conditions,” but to also do everything possible to prevent displacement of artists or anyone else living in non-permitted structures.

The outcry for stronger code enforcement and prohibition of underground events has created a quandary for the mayor, whose ties to the warehouse community go back decades.

During her first summer out of law school in 1990, Schaaf took an unpaid internship for the nonprofit California Lawyers for the Arts, working out of an office in Oakland called Art House.

“It literally existed to preserve living and working spaces for artists in Oakland,” Schaaf said in a June interview.

Over the next two and a half decades, Schaaf helped bring the city’s arts renaissance into City Hall. As a special assistant to then-Mayor Jerry Brown in 2005, she played a pivotal role in starting the monthly Art Murmur gallery walk, setting up meetings between the mayor and the organizers and securing funding for portable toilets. As mayor she held an inauguration party at the sprawling American Steel warehouse, rode a fire-breathing snail art car around Lake Merritt, and convened an Artist Housing and Workspace Task Force to keep Oakland’s creative class from getting priced out amid an economic boom.

“How the arts contribute to Oakland is so much bigger than just our economy — it’s part of our identity, it’s part of what has made me in love with this city all my life,” Schaaf said Friday.

Her alliance with the arts scene may be deep-rooted and personal, but it’s also helped appease her core constituency: a powerful, well-heeled voting bloc in the Oakland hills.

“She was elected by voters east of the 580 freeway, (who) like to live in a city that is welcoming and vibrant for artists,” said Oakland political consultant Jim Ross. “She doesn’t want to be seen as the mayor who quashed the artistic community in Oakland. That would not play well in the hills, and it’s not how she wants to be positioned.”

But San Francisco State University Professor Joe Tuman, who ran unsuccessfully against Schaaf in 2014, sees the post-Ghost Ship campaign to save artist warehouses as a bizarre way of responding to a horrific fire.

“If you made sure that structures had a sprinkler (system), and that the wiring was up to code, that’s not about punishing artists,” Tuman said. “That’s about making sure spaces are habitable and safe.”

He and others view the mayor’s performance in stark contrast to her handling of a massive sexual misconduct scandal in Oakland’s Police Department, which happened months before the fire and also elicited national attention.

In that instance Schaaf took a much harder line, condemning the police force’s “frat house” culture and entrusting City Administrator Sabrina Landreth to take over the department after the abrupt departures — one was dismissed and two resigned — of three police chiefs in nine days. Last week, Schaaf named the city’s first female police chief, Anne Kirkpatrick, to usher in a new era of reform.

Tuman, who praised that cleanup effort, is puzzled that he hasn’t seen the same hard-nosed action following the Ghost Ship fire.

“The mayor went out of her way to say there’s not going to be any scapegoating from this,” Tuman said. “But this isn’t about scapegoating, it’s about holding people accountable.”

Schaaf said the city is conducting its own examination of the fire, and of its past inspection and code enforcement processes, with help from outside experts. No evidence of negligence by a city employee has surfaced thus far, she said, reiterating that it’s the city’s job “not to grandstand or scapegoat” at a moment of high emotions.

The mayor rejects criticism that she squandered an opportunity to show real leadership when Oakland needed it most.

On Friday, she pulled out a letter from Anna Mendiola, whose 35-year-old sister-in-law, Jennifer Mendiola, had dreamed of becoming a professor in health psychology before she died at the Ghost Ship.

“None of the families ate or slept as we endured the grim wait for notification,” Mendiola wrote. “But the mayor, the sheriff and deputies, firefighters, coroners and first responders ate and slept even less than us. They worked relentlessly.”

Tears cut through Schaaf’s eyes as she stared at the paper.

“It shows me that my priorities are right,” she said.

Rachel Swan is a San Francisco Chronicle staff writer. Email: rswan@sfchronicle.com Twitter: @rachelswan