MINNEAPOLIS —  The prosecutor in the Minnesota county where Prince died says he's filing no criminal charges in the musician's death hours after documents revealed a doctor accused of illegally prescribing an opioid for Prince had agreed to pay $30,000 to settle a federal civil violation.

At a press conference Thursday, officials said Prince took counterfeit Vicodin containing fentanyl, and that "there is no evidence" he or anyone associated with him knew he had pills contained fentanyl.

The announcement Thursday from Carver County Attorney Mark Metz means the state's investigation into how Prince got the fentanyl that killed him is closed.

A newly unsealed federal search warrant says the Minnesota doctor who treated Prince in the weeks before he died expressed concern that the musician was suffering from opiate withdrawal.

The document unsealed Thursday says Dr. Michael Todd Schulenberg saw Prince on April 7, 2016, at the request of Prince's friend, Kirk Johnson, and prescribed Vitamin D and ondansetron under Johnson's name. 

Johnson called the doctor on April 14 and asked him to prescribe a pain medication for Prince. Authorities say Schulenberg prescribed oxycodone for Prince, again under Johnson's name. Schulenberg disputes that, but is paying $30,000 to settle a civil violation. 

The doctor also saw Prince on April 20 when Prince was reporting feeling antsy. A urinalysis tested positive for opioids.

Prince was found dead of a fentanyl overdose the next day. The doctor is not facing criminal charges and his attorney says he had no role in Prince's death. 

Metz said there was no evidence any person associated with Prince knew he possessed any counterfeit pill containing fentanyl.

"In all likelihood Prince had no idea he was taking a counterfeit pill that could kill him," Metz said.

Prince was 57 when he was found alone and unresponsive in an elevator at his Paisley Park estate on April 21, 2016. 

The Associated Press contributed to this report.