Barbara Garcia, director of San Francisco’s Department of Public Health, has resigned, leaving the department without a permanent leader as the city considers opening a safe injection site and continues to deal with rampant drug use and problematic behavior by the mentally ill on its streets.

Garcia had worked at the department since 1999, serving in a range of roles, including deputy director and director of community substance abuse services. She stepped down officially on Tuesday.

Greg Wagner, the department’s chief financial officer, will serve as acting director and the search for a new director will begin immediately, the department said.

“During her tenure, Barbara has done much for the health of our city, including completing the rebuilding of Zuckerberg San Francisco General Hospital and Trauma Center, inaugurating the San Francisco Health Network and achieving Public Health Accreditation status for the department,” Dr. Edward Chow, president of the San Francisco Health Commission, said in a statement.

Garcia could not be reached for comment Wednesday afternoon, but a department spokeswoman said she stepped down of her own accord.

Garcia was often seen as an ally to Mayor London Breed, particularly when it came to safe injection sites, where drug users can shoot up under supervision. Under Garcia, San Francisco was on track to open the country’s first two safe injection sites this summer. But that plan has been delayed because of legal issues and potential ramifications from the Trump administration.

Still, Garcia was determined to move ahead. Breed is a staunch supporter of safe injection sites, and is committed to opening one in San Francisco.

In an email to the department staff announcing her resignation, Garcia said she will continue to support the mayor — and urged the department to do the same.

“As you know, there is still so much work to do, especially in our communities of color,” she wrote in the email. “I am confident of your commitment to continue to raise the health status of all people in San Francisco.”

Her resignation comes one day after the state Legislature passed a bill that would allow San Francisco to open up a safe injection site under a three-year pilot program. Gov. Jerry Brown has yet to sign the bill. While an injection site would be legal under state law, it would still violate federal law.

In a statement, the mayor’s office said that under Garcia’s watch, the department was at the “forefront of some of the most progressive health policies in the nation and has served as a model for other cities.”

“She is a committed public servant who has worked tirelessly to ensure that ALL San Franciscans, especially our underserved communities, have the access to public health they deserve,” the statement said.

Trisha Thadani is a San Francisco Chronicle staff writer. Email: tthadani@sfchronicle.com Twitter: @TrishaThadani