Prince, shown performing in Los Angeles in 2009, died April 21 at age 57. (Kristian Dowling / Getty Images)

Prince saw a Minneapolis-area doctor the day before he died, and that doctor was at Prince's Paisley Park compound to deliver test results on the morning the musician was found dead, according to court records obtained by the Los Angeles Times.

Michael Todd Schulenberg, who specializes in family medicine, had also seen Prince earlier in the month, on April 7. He told investigators he had prescribed medication to Prince. The singer was supposed to fill the prescription at Walgreens, although it is unclear from the warrant whether he did.

The search warrant for Prince's medical records was filed April 27 and carried out May 5. The warrant, which misspelled the doctor's name, was executed at North Memorial Medical Center, where Schulenberg worked.

Schulenberg, whose LinkedIn profile page has been removed from public view, no longer works for the North Memorial Health Care system, where he was a family healthcare provider, said Lesa Bader, a system spokeswoman.

Bader said she couldn't give more details about when and why Schulenberg left his job, citing policies that protect employment information. In addition, she said, federal health privacy law prohibited her from releasing information on patients.

The Times tried, without success, to reach Schulenberg for comment. No one answered the door at an address listed under his name in Chaska, a suburb southwest of Minneapolis, but someone rolled down an open garage door after a Times reporter walked away. A message left at the door drew no response.

The warrant does not clarify whether Schulenberg was one of the people who found Prince dead at the compound on April 21 or whether Schulenberg arrived when investigators were already at the scene.

It also does not say anything about the prescription painkillers that Prince had reportedly been using, or whether Prince was being treated for opioid dependency.

Six days before his death, Prince fell unconscious in a private plane, which then made an emergency landing in western Illinois. He was reportedly treated there with an opioid overdose antidote.

A friend of Prince's, Kirk Johnson, told investigators that Prince had also been hospitalized in either 2014 or 2015 and had to be treated with fluids, according to the warrant.

On Oct. 23, 2013, an unidentified man, described as 53 years old and showing signs of dehydration, was picked up at Paisley Park and taken to a medical center with the same address as the facility listed in the search warrant, according to 911 call logs released by the Carver County Sheriff's Office. It's not clear whether Prince, who was 55 at the time, was the unidentified man.

Johnson has not responded to messages seeking comment.

Prince's cause of death remains undetermined. Investigators have declined to discuss details of the investigation or give a timeline for when the cause might be announced.

"That shouldn't be a surprise to anybody that these records were examined," Carver County Chief Deputy Jason Kamerud said when contacted for comment about the contents of the warrant, noting investigators had previously said they would be examining Prince's medical history.