LOS ANGELES — Federal prosecutors have charged a Hollywood Hills man in connection with the death of hip-hop artist Mac Miller, who was found dead of a drug overdose nearly a year ago, according to a federal criminal complaint unsealed Wednesday.

The 42-page criminal complaint filed in the Central District of California alleges that Cameron James Pettit, 28, supplied Miller with counterfeit oxycodone pills containing fentanyl. Miller had asked to be furnished with "percs," an abbreviation for percocet, a prescribed painkiller containing oxycodone.

Miller was discovered unresponsive in his Studio City home on Sept. 7, 2018. The manner of death was certified as an accident, although it was later determined that the rapper died from an overdose of alcohol, cocaine and fentanyl.

Download the NBC News app for breaking news and politics

Investigators, who served search warrants at multiple locations, recovered a plastic bag containing pills allegedly supplied by a prostitute and a madam. Two days earlier, Pettit delivered to Miller counterfeit oxycodone pills that contained fentanyl, cocaine and Xanax.

Authorities believe Miller died after snorting the bogus painkillers, according to a DEA statement.

"We are aggressively targeting drug dealers responsible for trafficking illicit fentanyl, which has become the most deadly facet of the opioid epidemic," said U.S. Attorney Nick Hanna. "We are committed to slowing the number of overdose deaths and prosecuting those responsible for spreading this most dangerous opioid."

"Fentanyl disguised as a genuine pharmaceutical is a killer," said Hanna, "which is being proven every day in America. Drugs laced with cheap and potent fentanyl are increasingly common, and we owe it to the victims and their families to aggressively target the drug dealers that cause these overdose deaths."

The criminal complaint detailed Instagram direct messages between Pettit and others reacting to the rapper's death. "I think I should probably not post anything …just to be smart," Pettit allegedly said in one of the texts.

Asked in another text message how he was doing, Pettit, who has been charged with one count of distribution of a controlled substance, allegedly wrote: "I am not great ... Most likely I will die in jail."

If convicted,the DEA says Pettit faces a statutory maximum sentence of 20 years in federal prison.

Born in Pittsburgh as Malcolm McCormick, Miller reportedly taught himself how to play piano, bass, guitar and drums as a young child, before switching to rap in high school.

Miller, who spoke publicly about his struggles with addiction, skyrocketed to fame eight years ago with the debut of his mixtape, "K.I.D.S. (Kickin’ Incredibly Dope S---)," which earned him a contract with Rostrum Records.

In the months leading up to his death, Miller was in the midst of a career resurgence with the debut of his fifth album, "Swimming." He planned to go out on tour in support of the album's release.

He had also been fodder for gossip publications in May 2018 following his high-profile breakup with pop star Ariana Grande.

He was arrested that same month after driving into a utility pole, leaving his vehicle at the scene and then testing over the alcohol limit. The Los Angeles County District Attorney's office had charged him with DUI and hit and run in connection with that incident.