Updated

The prosecutor in the Minnesota county where Prince died announced Thursday there will be no criminal charges filed in Prince's death after a two-year probe failed to find evidence of who provided the late singer with counterfeit Vicodin that was laced with fentanyl.

The announcement came 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.

Metz said the evidence shows Prince thought he was taking Vicodin, not fentanyl. He said there's no evidence any person associated with Prince knew he possessed any counterfeit pill containing fentanyl.

"Despite their extensive efforts, law enforcement was unable to determine the source of the counterfeit Vicodin laced with fentanyl," Metz said. "Nothing in the evidence suggests Prince knowingly took fentanyl."

prince

In this May 19, 2013, file photo, Prince performs at the Billboard Music Awards at the MGM Grand Garden Arena in Las Vegas. (AP)

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

An autopsy found Prince died of an accidental overdose of fentanyl, a synthetic opioid 50 times more powerful than heroin.

While Carver County said it was ending its role in the case, the U.S. Attorney's Office had no immediate comment on the status of its investigation.

But a law enforcement official close to the investigation told The Associated Press that the federal investigation is now inactive unless new information comes forward. The official spoke on condition of anonymity because the case remains open.

Federal prosecutors and the U.S. Drug Enforcement Administration alleged Schulenberg, a family physician who saw Prince at least twice before he died, violated the Controlled Substances Act when he wrote a prescription in the name of someone else on April 14, 2016.

The settlement, dated Monday, does not name Prince or make any references to the Prince investigation. However, search warrants previously released say Schulenberg told authorities he prescribed oxycodone to Prince on April 14 and put it under the name of Prince's bodyguard and close friend, Kirk Johnson, "for Prince's privacy."

Schulenberg's attorney, Amy Conners, has disputed that and did so again on Thursday, saying that Schulenberg settled the case to avoid the expense and uncertain outcome of litigation.

Oxycodone, the generic name for the active ingredient in OxyContin, was not listed as a cause of Prince's death. But it is part of a family of painkillers driving the nation's overdose and addiction epidemic, according to the U.S. Centers for Disease Control and Prevention. Nearly 2 million Americans abused or were addicted to prescription opioids, including oxycodone, in 2014.

A laboratory report obtained by The Associated Press notes that one of the pills found in a prescription bottle in Paisley Park that bore Johnson's name tested positive for oxycodone.

The settlement notes that the agreement "is neither an admission of facts nor liability by Dr. Schulenberg." And in a separate letter to Schulenberg's attorneys, prosecutors say Schulenberg is not currently a target of any criminal investigation.

It's illegal for a doctor to write a prescription for someone under another person's name. Anyone convicted of doing so could lose their DEA registration — meaning they could no longer prescribe controlled substances — and could face discipline from their state medical board.

The settlement says the DEA won't revoke Schulenberg's registration, unless he does not comply. It's unclear whether the state medical board will take action. His license is currently active and he has no disciplinary action against him.

Prince did not have a prescription for fentanyl. While many who knew Prince over the years said he had a reputation for clean living, some said he also struggled with pain after years of performing at an intense level. Documents unsealed last year paint a picture of a man struggling with an addiction to prescription opioids and withdrawal, and they also show there were efforts to get him help.

Just six days before he died, Prince passed out on a plane, and an emergency stop was made in Moline, Illinois. The musician had to be revived with two doses of a drug that reverses the effects of an opioid overdose.

The day before his death, Paisley Park staffers contacted California addiction specialist Dr. Howard Kornfeld as they were trying to get Prince help. Kornfeld sent his son, Andrew, to Minnesota that night, and the younger Kornfeld was among those who found Prince's body. Andrew Kornfeld was carrying buprenorphine, a medication that can be used to help treat opioid addiction.

The Associated Press contributed to this report.