Two years ago, when opioid-related fatalities overtook homicides as the District’s leading cause of preventable deaths, Mayor Muriel E. Bowser vowed to cut fatal overdoses in half by this fall.

But deaths continued to rise, and 2020 will end as the deadliest year yet in the city’s opioid crisis, mirroring a surge of overdoses nationally.

Officials recorded 282 fatal overdoses in the nation’s capital by the end of August, according to the most recent statistics, one more than in all of 2019. April, with nearly 50 fatalities, was the deadliest month of the epidemic in five years.

Advocates and health officials say the continued rise of the potent additive fentanyl is one reason the city has been unable to stem the tide, along with the isolation and despair caused by the coronavirus pandemic. Critics of the city’s efforts say the government must do far more to connect addicts with treatment and prevention programs.

D.C. lawmakers on Tuesday approved several opioid-related measures, including expanding the ranks of city employees carrying overdose antidotes and broadening “good Samaritan” laws to protect other drug users from prosecution if they report or attempt to reverse an overdose. The council also voted to decriminalize drug paraphernalia, an attempt to treat addiction as a public health problem instead of a criminal justice issue.

Some of the legislation was drafted in response to a 2018 Washington Post investigation that found city agencies had responded slowly to the spike in fatalities in recent years, particularly among older Black men who had used heroin with relative safety for decades before the arrival of fentanyl.

The bills must be signed by Bowser (D) to become law.

“We are confronting so many crises all at the same time,” said Council member Charles Allen (D-Ward 6), who spearheaded the legislation, citing coronavirus fatalities and a spike in homicides. “There’s a really strong sense of urgency to continue the work of reducing opioid deaths.”

Deputy Mayor for Health and Human Services Wayne Turnage said in an interview that he believes the record number of overdoses can be attributed to the local drug supply becoming more potent and to more people using drugs alone at home during the pandemic — without anyone to report an overdose.

He has instructed health officials to reevaluate their strategy for preventing deaths, but he said the city can go only so far with outreach and connecting people to treatment.

“You can’t beat the addiction for them,” Turnage said. “You have to be there to meet them and help them. But at the end of the day, they have to find a way to come off this drug before it kills them.”

Edwin Chapman, a physician who has treated substance-use disorder in the District for decades, said reversing overdoses and making it safer to report them partially addresses the issue. He said the city needs to do more to make it easier for Medicaid patients to get access to buprenorphine, which curbs opioid cravings; connect D.C. jail inmates to drug treatment; and compel insurers to cover the treatment addicts need.

“Resuscitation is just the first step,” Chapman said. “If you don’t have a place to send the patients with a warm handoff, then it really just becomes a revolving door.”

The District is not alone in confronting a rise of opioid deaths; more than 40 states have reported an increase in fatalities this year. Experts note that the pandemic has caused the cancellation of in-person recovery meetings and prompted health officials to urge people to limit close contact with others.

“One of the most important things we tell people to do is don’t get isolated, get out of your environment or place where you are using and/or drinking and go meet up with other people working on recovery,” said Stephen Taylor, a psychiatrist on the board of the American Society of Addiction Medicine.

“Now we have this pandemic, which has literally forced people to do the opposite of what we know helps them stay in recovery.”

But in the District and nationally, the spike in overdose fatalities began before the first wave of shutdowns and stay-at-home orders in March.

The Centers for Disease Control and Prevention estimates that about 19,000 people died of a drug overdose — including non-opioids — in the first three months of this year, a 16 percent year-over-year increase. The District saw fatalities begin to rise sharply in late 2019.

The Bowser administration had already launched a sweeping plan to reduce overdose deaths with a variety of treatment, education and prevention initiatives, following The Post’s investigation. Chief among the strategies was expanding the availability of naloxone, a fast-acting overdose reversal drug that can be injected or sprayed in the nose.

City officials relented on allowing pharmacies to provide the drug over the counter and armed police officers with thousands of antidote kits. Three hospitals last year started programs to connect overdose patients with buprenorphine.

Advocates say this year’s death toll may have been even worse without these measures. D.C. police administered naloxone at least 581 times through September, data shows, compared with 482 times in 2019, when police first started carrying the antidote.

The legislation pending before the mayor requires city health workers — including those who work with people who are homeless or have mental health disorders — to have access to naloxone, also known by the brand name Narcan.

Turnage said he supports efforts to expand access to the antidote, which he said is already widely available, with 85,000 kits distributed over the past two years.

“The more Narcan that’s out there, the more we are likely to save somebody’s life,” said Andy Robie, a D.C. physician who focuses on opioid abuse.

Lawmakers also approved granting criminal immunity to people reporting drug overdoses, even if they were also using, and to those who attempt to administer naloxone. Advocates say some drug users are afraid to call 911 or seek help out of fear that they will be prosecuted.

D.C. police did not raise concerns about those provisions. But they did object to lawmakers decriminalizing possession of drug paraphernalia, such as needles and syringes, for personal use.

Robert Contee, the assistant chief of the Investigative Services Bureau, told the council that residents frequently complain about unsafely discarded paraphernalia and that criminal penalties help police limit the drug supply.

“A needle or syringe may be an important and necessary piece of evidence for limiting drug distribution and trafficking, as well as for identifying and tracking the spread of new types of synthetic drugs,” Contee testified at a 2018 hearing.

But Allen, the bill’s author, said locking up users is exacerbating the crisis. Lawmakers previously decriminalized the strips used to test heroin for fentanyl, which one local nonprofit said resulted in a rise of drug users changing their habits to abstain or lower their dosage.

Allen also said decriminalization would reduce racial disparities in law enforcement, noting that 80 percent of the roughly 7,000 people arrested on paraphernalia charges between 2010 and 2020 were Black.

One controversial proposal involves creating safe sites to allow people to inject heroin while under medical supervision. Philadelphia has been preparing to open the nation’s first such facility, but the plans have been disrupted by litigation and the pandemic.

Turnage said he sees merits to the idea but is wary of promoting drug use and would prefer to see data from other sites before the District considers it.

Allen, however, said creating a safe site in the District is the natural next step.

“We take a criminalized approach, and people still use, so what’s our goal at the end of the day?” Allen said. “I want to help that person, and I don’t want them to overdose, and I don’t want them to die.”

An earlier version of this story misstated the number of nalozone kits distributed this year in the District.