Legendary rock musician Tom Petty died from an accident fentanyl overdose after “taking a variety of medications,” his family said Friday.

“Our family sat together this morning with the Medical Examiner-Coroner’s office and we were informed of their final analysis that Tom Petty passed away due to an accident drug overdose,” the family said in a statement.

Noting the former frontman of Tom Petty and the Heartbreakers “suffered from many serious ailments,” including a fractured hip, his wife Dana Petty and one of his daughters, Adria Petty, said the overdoes was “an unfortunate accident.”

“As a family we recognize this report may spark a further discussion on the opioid crisis and we feel that is a healthy and necessary discussion and we hope in some was this report can save lives,” they wrote. “Many people who overdose begin with a legitimate injury or simply do not understand the potency and deadly nature of these medications.”

“On a positive note we now know for certain he went painlessness and beautifully exhausted after doing what he loves 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,” they added.

“Thank you also for respecting the memory of a man who was truly great during his time on this planet both publicly and privately.”

Petty passed away on Oct. 2, 207 after suffering a “massive” cardiac arrest at his Malibu home.