Mac Miller’s cause of death has been revealed.

The American rapper died of an accidental overdose after consuming a lethal combination of drugs and alcohol, TMZ reports.

The coroner said the death was caused by “mixed drug toxicity”, with cocaine, fentanyl and ethanol all found in Miller’s system.

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 early this year. Following his death, she said Miller was her “dearest friend”.

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

This week Grande released Thank U, Next, a song about her exes including Pete Davidson and Miller, in which she called Mac “an angel”.