His family said in a statement that Miller died Friday but gave no further details. "He was a bright light in this world for his family, friends and fans," the statement said.
Miller, who also drew headlines for his two-year relationship with singer Ariana Grande that ended earlier this year, apparently died in Los Angeles.
Los Angeles police said they responded to a report of a deceased person at a home on the same block where Miller is listed as a resident, and had turned the case over to the coroner's office. The coroner's office said it did not have any details it could release.
Police lines were pulled up and a coroner's van left the cul-de-sac late Friday afternoon. About 10 news vans remained. Another rapper, Pittsburgh Slim, appeared and left flowers in front of Miller's house.
While Miller didn't have a hit on Top 40 radio, he had a strong following on streaming networks and even had an album debut at No. 1 on the top 200 albums chart. He often alluded to his battles with addiction over the years and had collaborations with Kendrick Lamar, Lil Wayne and Ty Dolla $ign.
He released his fifth, full-length album "Swimming" last month, with Variety calling it "a simple, stately, poetic autobiography." Rolling Stone called it "silky, deep vibe redolent of the L.A. alternative soul scene." New Musical Express said it was "his best work in years."
The album included the song "Come Back to Earth," with Miller trying to chart his way through tough times: "In my own way, I feel like living some alternate reality/And I was drowning, but now I'm swimming through stressful waters to relief."
He was due to start a tour at the end of next month that he promised would be special every night. On Thursday he tweeted: "I just wanna go on tour."
At the news of his death, Chance the Rapper tweeted: "I don't know what to say Mac Miller took me on my second tour ever. But beyond helping me launch my career he was one of the sweetest guys I ever knew. Great man. I loved him for real. I'm completely broken. God bless him."
J Cole said on Twitter: "This is a message for anybody in this game that's going through something. If you don't feel right, if you feel you have a substance problem, if you need a ear to vent to. If you uncomfortable talking to people around you. Please reach out to me."
Miller and Grande collaborated on her first top 10 hit, the multiplatinum, "The Way," which propelled her from teen TV stardom to pop star, and they dated for two years before their relationship ended in May. She later called it a "toxic" relationship on Twitter.
Not long after he was charged with DUI and hit and run after police said he struck a power pole and fled the scene. His blood alcohol was reportedly twice the legal limit.
"I made a stupid mistake. I'm a human being," Miller told Zane Lowe on Beats 1 on Apple Music in July. "But it was the best thing that could have happened. Best thing that could have happened. I needed that. I needed to run into that light pole and literally have the whole thing stop."
The Pittsburgh native, born Malcolm McCormick, rose to fame with a frat-rap attitude in his mixtapes like "Best Day Ever" and his full-length album debut, 2011's "Blue Slide Park." His more goofy songs included "Nikes on My Feet," ''Kool Aid & Frozen Pizza" and "Knock Knock."
One of his biggest songs was the 2011 platinum-certified mixtape track "Donald Trump," which prompted a feud with the future president. He asked his fans not to vote for Trump, who was flirting with the idea of running for president then, and publicly supported the Black Lives Matter movement.
In 2013, his sophomore effort, "Watching Movies with the Sound Off," entered the Billboard 200 at No. 3. Miller sold more than 100,000 copies of the woozy, moody album, which features appearances or production work from Diplo, Flying Lotus, Earl Sweatshirt, Jay Electronica and Action Bronson. He also landed a reality series, "Mac Miller and the Most Dope Family," in 2013, which ran for two seasons on MTV2.
Miller told The Associated Press that year that the album's depth and quality reflected two years of warp-speed development, his move from Pittsburgh to Los Angeles and just how serious he was about the craft. "There was always a lot more to me than what people wanted to say, that's the only thing that ever bothered me," Miller said.
His 2016 release "The Divine Feminine" had contributions from Kendrick Lamar, Anderson .Paak, Cee-Lo Green and Grande. Pitchfork magazine called it "the most surprising, concise, and accomplished album of his career."
Miller's label, Warner Bros., released a statement calling him "a hugely gifted and inspiring artist, with a pioneering spirit and a sense of humor that touched everyone he met. Mac's death is a devastating loss and cuts short a life and a talent of huge potential, where the possibilities felt limitless."
Back in May, McCormick was arrested for allegedly driving under the influence following a crash in Studio City.
McCormick and pop star Ariana Grande had broken up earlier that month, with Grande tweeting afterward: "pls take care of yourself."
pls take care of yourself— Ariana Grande (@ArianaGrande) May 17, 2018
McCormick's last tweet was posted on 6:45 p.m. Thursday about his upcoming tour, set to begin in October.
Go get tickets for tour.— Mac (@MacMiller) September 7, 2018
I’m bringing a band.
The show is going to be special every night.
I wish it started tomorrow.
It starts October 27th.https://t.co/RGYZC5DTza
MORE: Rapper Mac Miller arrested on suspicion of DUI after Studio City hit-and-run
The Associated Press contributed to this report.