Mac Miller died Friday of an apparent overdose ... TMZ has learned.
Law enforcement sources tell TMZ ... Mac was found Friday at around noon at his San Fernando Valley home and was pronounced dead at the scene.
We're told authorities were alerted by a male friend who placed a 911 call from Mac's home.
Miller has had trouble recently with substance abuse ... in the wake of his breakup with Ariana Grande. The rapper wrecked his G-Wagon by wrapping it around a utility pole back in May and was arrested for DUI and hit and run. He fled the scene but cops say he later confessed at his home. He blew 2 times the legal limit.