San Francisco is in the middle of a drug crisis. Overdose deaths reached a record high last year, topping 800. Public drug use is widespread in some neighborhoods.

How did San Francisco get to this point? In part, it follows the national story: The rise of fentanyl, a synthetic opioid, and a destabilizing pandemic caused a spike in addiction and overdose deaths.

But San Francisco’s drug crisis has outpaced the country’s. In 2014, the city’s overdose death rate was roughly in line with the national average. As of last year, its rate was more than double the national average, and San Francisco was No. 4 for overdose deaths among U.S. counties with more than 500,000 people. The country’s overdose crisis worsened over the past decade as fentanyl spread, but San Francisco’s worsened much more quickly.

Local policy changes are partly to blame, some experts say. In 2014, California voters passed Prop 47, reducing drug possession to a misdemeanor from a felony. Different parts of the state have interpreted the change differently. In San Francisco, law enforcement has responded by scaling back efforts against drugs, de-emphasizing incarceration and effectively allowing public drug use.

Those who support at least partial decriminalization often cite the experience of Portugal, which decriminalized all drugs more than two decades ago and then saw a decline in drug-related problems. In 2019, the San Francisco district attorney at the time, George Gascón, even visited Portugal to learn more. But while San Francisco and other liberal cities have embraced some aspects of Portugal’s decriminalization laws, they have struggled to replicate Portugal’s success.