Prince performs during his 'Diamonds and Pearls Tour' at the Earl's Court Arena in London, Britain, June 15, 1992. REUTERS/Dylan Martinez

Music superstar Prince, who was found dead in his home in a Minneapolis suburb in late April, died of an accidental, self-administered overdose of an opioid painkiller, the county medical examiner said in a death report on Thursday.

The Midwest Medical Examiner’s Office in Anoka County, Minnesota, had been investigating the 57-year-old singer’s death since he was discovered in an elevator in his home and studio on April 21.

“The decedent self-administered fentanyl,” the medical examiner’s report said, listing cause of death as “fentanyl toxicity” and noting it was accidental.

The investigation into Prince’s death has centered on painkillers after prescription opioid medication was found at the scene and after reports he had been struggling with an addiction and had been scheduled to meet with a doctor who specializes in treating dependency.

The Minneapolis Star Tribune said it was not clear whether fentanyl had been prescribed to Prince and if so, which doctor prescribed it.

Fentanyl is often sold illegally and the U.S. Centers for Disease Control has said that rising drug overdose deaths in the United States are linked to increased use of illicitly manufactured fentanyl.

The local prosecutor, Carver County Attorney Mark Metz, said the county sheriff’s office continues to investigate Prince’s death, assisted by federal authorities, but at this point has not handed over the results of the probe to prosecutors.

“They will be looking at many different things,” Metz told Reuters by telephone.

Prince, whose full name was Prince Rogers Nelson, did not leave a will, and his multimillion-dollar estate including royalties from his more than 30 albums is being handled by a court. The songwriter’s hits include “Purple Rain” and “When Doves Cry.”