A man has been charged in the death of Mac Miller, almost a year after the rapper died of an overdose.

E! News reports that Cameron James Pettit, a Hollywood Hills resident, has been arrested for allegedly selling Miller pharmaceutical drugs containing fentanyl, two days before his death.

According to court documents, Petit agreed to sell Miller “30 milligram oxycodone pills, as well as cocaine and the sedative Xanax.” But the following day, when the deal was made, he instead sold the rapper “counterfeit oxycodone pills that contained fentanyl.”

After news of Miller’s death at 26 broke, Petit allegedly texted a friend saying, “Most likely I will die in jail.”

“Fentanyl disguised as a genuine pharmaceutical is a killer – which is being proven every day in America,” United States Attorney Nick Hanna said.

“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.”

Police were called to Miller’s Los Angeles home on September 7, where he was pronounced dead at the scene.

The rapper was in a relationship with Ariana Grande for two years until a few months before his untimely death. In a statement, Grande said Miller was her “dearest friend”.

“I adored you from the day I met you when I was nineteen and I always will.”

In her smash-hit Thank U, Next, her song about her exes including Pete Davidson and Miller, she called Mac “an angel”.