But like many librarians, she saw plenty of chaos. Patrons racked by untreated mental illness or high on drugs sometimes spit on library staffers or overdosed in the bathrooms. She remembers a co-worker being punched in the face on his way back from a lunch break. One afternoon in 2017, a man jumped to his death from the library’s fifth-floor balcony.

Dunseth retired the following year at age 61, making an early exit from a nearly 40-year career.

“The public library should be a sanctuary for everyone,” she said. The problem was she and many of her colleagues no longer felt safe doing their jobs.

Libraries have long been one of society’s great equalizers, offering knowledge to anyone who craves it. As public buildings, often with long hours, they also have become orderly havens for people with nowhere else to go. In recent years, amid unrelenting demand for safety-net services, libraries have been asked by community leaders to formalize that role, expanding beyond books and computers to providing on-site outreach and support for people living on the streets. In big cities and small towns, many now offer help accessing housing, food stamps, medical care, and sometimes even showers or haircuts. Librarians, in turn, have been called on to play the role of welfare workers, first responders, therapists, and security guards.

Librarians are divided about those evolving duties. Although many embrace the new role — some voluntarily carry the opioid overdose reversal drug naloxone — others feel overwhelmed and unprepared for regular run-ins with aggressive or unstable patrons.

“Some of my co-workers are very engaged with helping people, and they’re able to do the work,” said Elissa Hardy, a trained social worker who until recently supervised a small team of caseworkers providing services in the Denver Public Library system. The city boasts that some 50 lives have been saved since library staffers five years ago began volunteering for training to respond to drug overdoses. Others, Hardy said, simply aren’t informed about the realities of the job. They enter the profession envisioning the cozy, hushed neighborhood libraries of their youth.

“And that’s what they think they’re walking into,” she said.

But many were ill prepared for the transformation in clientele as drug addiction, untreated psychosis, and a lack of affordable housing have swelled homeless populations in a broad array of U.S. cities and suburbs, particularly on the West Coast.

Amanda Oliver, author of “Overdue: Reckoning With the Public Library,” which recounted nine months she worked at a Washington, D.C., branch, said that while an employee of the library, she was legally forbidden to talk publicly about frequent incidents such as patrons passing out drunk, screaming at invisible adversaries, and carrying bed bug-infested luggage into the library. This widespread “denial of how things are” among library managers was a complaint Oliver said she heard echoed by many staffers.

The 2022 Urban Trauma Library Study, spearheaded by a group of New York City-based librarians, surveyed urban library workers and found nearly 70% said they had dealt with patrons whose behavior was violent or aggressive, from intimidating rants and sexual harassment to people pulling guns and knives or hurling staplers at them. Few of the workers felt supported by their bosses.

“As the social safety net has been dismantled and underfunded, libraries have been left to pick up the slack,” wrote the authors, adding that most institutions lack practical guidelines for treating traumatic incidents that over time can lead to “compassion fatigue.”

Library administrators have begun to acknowledge the problem by providing training and hiring staff members experienced in social services. Ensuring library staffers did not feel traumatized was a large part of her focus during her years with the Denver libraries, said Hardy. She and other library social workers in cities such as San Francisco and Washington have worked in recent years to organize training programs for librarians on topics from self-care to strategies for defusing conflict.

About 80% of librarians are women, and the library workforce skews older, with nearly a third of staff members over 55. As in many professions, salaries have failed to keep pace with rising costs. According to the American Library Association-Allied Professional Association, the average salary for a public librarian in the U.S. was $65,339 in 2019, the most recent year for which data is available.

Studies confirm that many librarians experience burnout.