Alarmed by the biggest surge in overdose deaths in years, Baltimore health officials are launching a campaign to make drug users aware that the heroin they buy on the street may contain the much more potent painkiller fentanyl.

There have been 39 deaths in the city linked to fentanyl in the first quarter of the year, up from 14 in the same period last year.

It is a grim uptick that has been seen across the state. Some health and law enforcement officials and counselors began issuing warnings more than a year ago but have not been able to stem overdoses.

There were 73 fentanyl-related overdose deaths in the first three months of the year in Maryland, or almost a quarter of all intoxication deaths. Those types of deaths were just 4 percent of intoxication deaths two years ago, according to state health data. The number now eclipses deaths related to cocaine and alcohol and is gaining on prescription drugs.

One of the latest fentanyl victims was a 16-year-old girl from Glen Burnie, Md., Crystal Moulden, who was found in a Baltimore alley in June. Her family said she was a straight-A student and cheerleader until she began drinking and smoking marijuana, eventually turning to harder drugs.

“It’s very concerning, especially when we hear reports about people who don’t know what they are using,” said Leana Wen, Baltimore City Health Commissioner. “They think they’re using heroin only. It stops their breathing within a minute or so because it’s so powerful.”

It’s not clear what is fueling the availability of fentanyl now, but it has become a statewide and national problem, and one that is tough to stop because some addicts may seek out the high from fentanyl, which is 30 to 50 times more potent than heroin, Wen said.

Baltimore is using trusted workers from its needle exchange program, in operation for two decades, to spread “lifesaving tips” rather than a message to quit heroin.

They tell users to avoid drugs that have different colors or textures, not use drugs alone and learn to use the overdose medication Naloxone. They also can steer people to addiction treatment.

“The idea is to keep people alive today so they can make better choices tomorrow,” Wen said.

The U.S. Drug Enforcement Administration began cracking down on illicitly produced fentanyl years ago, hoping to curb overdoses. The drug has been around for decades, used legally by cancer patients and those with chronic pain.

Fentanyl overdose deaths surged in 2005 and continued for two years until the DEA shut a single lab in Mexico, agency officials said. But cases began climbing again in 2014, particularly in the Northeast and California.

Deaths related to fentanyl in Maryland tripled to 185 last year from 58 in 2013, state data show. Baltimore made up more than a third of the total.

Heroin deaths also are rising, with 578 people succumbing last year, a 25 percent increase from the previous year and more than double the 2010 total.

Public health officials have been looking for the best approach to curb the deaths, with Maryland forming a task force that has been visiting all corners of the state and expects to send recommendations to the governor by year’s end.

Anne Arundel County, where the promising teenager was from, also formed a task force last year. The county had 23 deaths from fentanyl last year, the third-highest number of deaths in the state, behind only Baltimore City with 71 deaths and Baltimore County with 36.