This year is on track to be the deadliest year on record for opioid-related deaths in Massachusetts.

The state has been grappling with a heroin and prescription pill epidemic for more than a decade, but has seen an exponential rise over the past three years as the synthetic opioid fentanyl has made its way to the streets.

The drug, which is estimated to be about 50 times as powerful as street heroin, is responsible for about 74 percent of the estimated 1,475 overdose deaths so far this year, according to a Massachusetts Department of Health study released this week.

The latest numbers, which tally opioid overdose deaths for the first nine months of the year, confirm 1,005 deaths and expect another 392 to 470 deaths will be attributed to opioids.

"Current estimates for the first nine months of 2016 are higher than the first nine months of 2015," according to the study.

Last year, there were 1,574 opioid related deaths—heroin was present in about 65 percent of tested cases. By the second quarter of this year, that number had dropped to 53 percent.

“While we continue to see a decline in the number of deaths involving heroin, the data released today are a sobering reminder of why the opioid crisis is so complex and a top public health priority,” Secretary of Health and Human Services Marylou Sudders said in a news release. “This is a crisis that touches every corner of our state, and we will continue our urgent focus expanding treatment access.”

While fentanyl is a pharmaceutical drug prescribed for severe pain, DPH said most of the fentanyl found in Massachusetts is manufactured illicitly.