Chris Graythen/Getty Images

Prince died from an overdose of the painkiller fentanyl, according to Minnesota’s Midwest Medical Examiner’s Office, which released the finding Thursday afternoon.

The report gives Prince’s official cause of death as accidental, caused by “fentanyl toxicity.” Fentanyl is a powerful synthetic painkiller that’s “similar to but more potent than morphine,” according to the National Institute on Drug Abuse, and is often prescribed to treat severe and/or chronic pain.

“The decedent self-administered fentanyl,” the report states.

The music legend died April 21 at age 57 at his Paisley Park estate in Chanhassen, MN, outside of Minneapolis. An autopsy was completed a day later.

Days after his death, Prince’s longtime attorney, L. Londell McMillan, disputed suggestions that the singer was addicted to drugs.

“People use medication. The question is, are you on meds in a dangerous way?” McMillan said, noting that Prince was a vegan.

“Everybody who knows Prince knows he wasn’t walking around drugged up,” McMillan said. “That’s foolish. No one ever saw Prince and said, ‘He looks high.’ It wasn’t what he was about.”

But there were clues that Prince may have struggling with opioid use prior to his death. The day before he died, Prince’s team contacted Dr. Howard Kornfeld, a California-based opioid-addiction specialist, according to Kornfeld’s attorney, William Mauzy.

Mauzy said Kornfeld’s son Andrew was sent to meet with the singer, though when he arrived at Paisley Park the morning of April 21, he and others discovered Prince unconscious in an elevator.

A search warrant connected to the death investigation showed Prince had met with another physician, Dr. Michael Todd Schulemberg, on April 7 and 20. Schulemberg was also there, delivering the results of medical tests, when the singer’s body was discovered.

Prince’s sister Tyka Nelson announced in a Facebook post that the family will hold an official memorial in August.

Copyright © 2016, ABC Radio. All rights reserved.