Tom Petty, the singer and guitarist whose influential music spanned four decades, died in October from an accidental drug overdose as a result of mixing medications involving opioids, his family announced Friday.

A Los Angeles County medical examiner-coroner’s report reveals that Petty had traces of multiple opioids including fentanyl in his system when he died at age 66 after being found unconscious at his home in Malibu, California. He had suffered cardiac arrest.

The cause of his death had until Friday remained a mystery. For months, his fans wondered what killed Petty after his death certificate, released about a week later, registered the cause of death as “deferred” pending an autopsy. He died a week after concluding a nationwide tour with his band, the Heartbreakers. He told Rolling Stone at the time that the tour might be his last.

Petty’s wife, Dana Petty, and his daughter, Adria Petty, wrote in a statement posted to the band’s website and Facebook page that Petty had suffered from emphysema, knee problems and a fractured hip. Out of commitment to his fans, he toured for 53 dates with the fractured hip. But the pain soon became unbearable and led Petty to turn to medication, the family said.

“We knew before the report was shared with us that he was prescribed various pain medications for a multitude of issues including Fentanyl patches and we feel confident that this was, as the coroner found, an unfortunate accident,” the family wrote.

The family shared the coroner’s report to “spark a further discussion on the opioid crisis.”

“We hope in some way this report can save lives,” the family wrote.

Fentanyl, a synthetic narcotic about 50 times stronger than heroin, is linked to thousands of overdoses and fatalities across the country. Fentanyl-related deaths increased nearly 600 percent from 2014 to 2016 in 24 of the nation’s biggest cities, according to health departments. A report by The Washington Post last year showed 582 fatal overdoses from fentanyl in 2014, followed by a surge to 3,946 such deaths in 2016.

Petty broke into the rock ‘n’ roll scene with the Heartbreakers in the 1970s with songs that included “Free Fallin’,” “I Won’t Back Down” and “American Girl.”

His family said they were proud Petty could still perform those songs for his fans on his 40th anniversary tour last year.

“We now know for certain he went painlessly and beautifully exhausted after doing what he loved the most, for one last time, performing live with his unmatchable rock band for his loyal fans on the biggest tour of his 40 plus year career,” Petty’s family wrote.