TAB 190905 Mac Miller-1567669157796
FILE - In this Saturday, July 13, 2013, file photo, Rapper Mac Miller performs on his Space Migration Tour at Festival Pier in Philadelphia. Mac Miller, the platinum hip-hop star whose rhymes vacillated from party raps to lyrics about depression and drug use, and earned kudos from the likes of Jay-Z and Chance the Rapper, died Friday, Sept. 7, 2018, at age 26. Police and paramedics found Miller unresponsive at his home in Los Angeles and declared him dead shortly before noon, coroner's spokeswoman Sarah Ardalani said. An autopsy will be required to determine the cause of death. (Photo by Owen Sweeney/Invision/AP, File) Image Credit: Owen Sweeney/Invision/AP

A Los Angeles man was arrested Wednesday on charges that he sold counterfeit opioid pills to Mac Miller two days before the rapper died of an overdose.

A Drug Enforcement Agency affidavit unsealed after the arrest of Cameron James Pettit alleges that Miller asked him for oxycodone and other drugs, but on September 5, 2018, Pettit gave Miller counterfeit oxycodone pills laced with the powerful opioid fentanyl.

Pettit, 28, who lives in the Hollywood Hills, appeared in court Wednesday but did not enter a plea. A judge ordered him held without bail and appointed him a public defender.

The 26-year-old Miller, who was known to many as Ariana Grande’s ex-boyfriend but was a respected rapper in his own right, was found dead by his assistant at his San Fernando Valley home on September 7, 2018.

An autopsy found that Miller died from an accidental overdose, via a combination of fentanyl, cocaine and alcohol.

Authorities found drugs they believe were from Pettit in Miller’s home, and evidence that Miller had crushed and sniffed oxycodone provided by Pettit.

Pettit has only been charged with providing the drugs, however, and not with having a direct role in Miller’s death. It was not immediately known if he had an attorney, and no relative or associate of Pettit could be found for comment.

After reports of Miller’s death circulated, Pettit sent an Instagram message to a friend saying, “Most likely I will die in jail,” according to the affidavit.

Pettit goes on to write, “I’m gonna get off the grid. Move to another country.”

A Pittsburgh native whose real name was Malcolm James Myers McCormick, Miller’s rhymes included frank discussion of his depression and drug use, earning him fans among some of the biggest names in hip hop.

Miller is the latest musician whose death has been linked in recent years to a national wave of opioid abuse and overdoses. Prince died in 2016 when he took counterfeit pills laced with fentanyl that looked like a generic version of the painkiller Vicodin.