Overdose deaths in Philadelphia declined during the end of 2017 and the start of the new year, offering a glimmer of hope amid the city's ongoing struggle with the opioid epidemic, health officials said Friday.

The medical examiner's office reported 257 overdose deaths from January to March this year — a 17 percent decline over the same period last year.

Numbers were similar from October to December 2017, with 250 deaths. That marks six consecutive months of a lower-than-normal overdose death rate in the city.

"It's nice to see the numbers going in the right direction," said health commissioner Tom Farley. "Up until now it's been moving in nothing but the wrong direction."

But the slice of positive news doesn't overshadow the larger problem. If deaths continue at the current rate, Philadelphia will record more than a thousand overdose deaths this year, "which is still a huge and tragically high number," Farley said. "We are not rejoicing about this," he said of the new report.

In 2017, 1,217 people died of overdoses in Philadelphia, and more than three-fourths of the deaths involved opioids.

While overdoses are heavily concentrated in the Kensington and Fairhill neighborhoods, they're touching every corner of the city. Officials don't know if the declines seen in early 2018 were particular to any neighborhood.

They're also uncertain if the lower numbers are part of a continuing trend or merely a fluctuation. It is difficult to predict what will happen the rest of this year, Farley said, but the city will continue working on multiple fronts to address the opioid crisis. That includes reducing the number of people who become addicted by encouraging doctors to prescribe fewer opioids, getting people into treatment programs as quickly as possible, and making the reversal drug naloxone widely available so someone who is overdosing can be revived.

"We definitely have not solved this problem yet," Farley said.

Last weekend, at least 165 people around the city overdosed — levels not seen in months. Ten people died. The spike, health officials confirmed late Friday, was mainly caused by a supply of heroin contaminated with a mix of fentanyl and a toxic synthetic cannabinoid.

"The Department of Public Health now believes that 5F-ADB was the primary cause of the cluster of patients with these adverse drug reactions," according to a department statement. "The drug 5F-ADB is a potent and highly toxic "synthetic cannabinoid" that has been seen with increasing frequency in Philadelphia in the last three years. The drug is typically smoked or administered with electronic vaping devices. This is the first known cluster in Philadelphia in which the drug was administered mainly by injection."

Overdose spikes are often seen when drugs sold on the street are cut with synthetic components, causing sometimes fatal reactions in unsuspecting buyers. Fentanyl, a powerful synthetic opioid, has been a large driver of overdose deaths, present in 84 percent of all opioid-related deaths in Philadelphia last year.

The city last reported an overdose spike in West Philadelphia in June, when 20 people overdosed on what officials suspected was fentanyl, sold as crack cocaine. Two people died.

Farley pointed to the numbers as proof that the city needs to open a safe-injection site, a controlled setting where people in addiction can use drugs under medical supervision, be revived if they overdose, and access treatment.