Test results show Prince died of an opioid overdose, a law enforcement official told the AP. The 57-year-old music icon was found dead on April 21 at his Paisley Park estate in Chanhassen, Minnesota. An autopsy was completed on April 22, but medical examiners said then that determining the results of toxicology tests could take weeks. Update (2:41 p.m. EST): The Midwest Medical Examiner's Office has officially announced the test results, specifying that the opioid in question was fentanyl, a powerful painkiller.

The Drug Enforcement Administration and the U.S. Attorney's Office have been helping local authorities in their investigation into Prince's death. Six days before Prince was found dead, he was hospitalized when his plane made an emergency landing in Moline, Illinois. He got treatment for an overdose of percocet, which contains oxycodone, a highly addictive opioid, TMZ reported shortly after his death.

A Minneapolis-area doctor was at Paisley Park to bring test results on the morning Prince's body was found, the Los Angeles Times reports, citing court records. Prince had reportedly visited the doctor, Michael Todd Schulenberg, the day before. A search warrant obtained by the Times didn't say when Schulenberg arrived at the scene or what medication he prescribed. Schulenberg also told investigators he had seen Prince on April 7, the day Prince postponed an Atlanta concert, and had prescribed him medication. A spokesperson for Schulenberg's most recent employer declined to comment, citing privacy policies, and attempts to contact Schulenberg were unsuccessful, according to the Times.

The court records also showed that Kirk Johnson, a friend, told investigators that Prince had been hospitalized in 2014 or 2015 and was treated with fluids. The cause of the hospital visit wasn't disclosed.

A California doctor, opioid addiction specialist Howard Kornfeld, was planning to fly out to see Prince on April 22, a lawyer working with the Kornfeld family recently told the Star Tribune. The attorney, William Mauzy, said Prince representatives called Kornfeld on April 20 because the musician "was dealing with a grave medical emergency." Kornfeld had a scheduling conflict the next day but sent his son Andrew to see Prince, with intentions of following himself a day later. Andrew Kornfeld was among the three people at Paisley Park when Prince's body was found, and he made the 911 call, Mauzy told the Star Tribune.

Find more on Prince and his legacy here.