It was the first day of Miami's Ultra Music Festival in 2012, and while Avicii's headlining performance wouldn't happen until the centerpiece 11 p.m. slot on Saturday night of dance music's biggest American bacchanal, his hit song "Levels" was already everywhere. Avicii had previewed the track a year before during one of his three sets at the festival's 2011 edition (his first time at the fest), and bits of the song's chugging electro riff could be heard blaring from the speakers of each of the seven stages set up across the 32 acres of the city's Bayfront park. From up-and-comers to legends of the genre like Fatboy Slim and David Guetta, it seemed it was a virtual mandate for almost every DJ to interpolate the track into their own set one way or another.

The year would also prove to be a pivotal one for EDM. There was the sense that electronic music, long a mainstream concern in Europe, South America, and elsewhere but viewed as a hedonistic niche genre in America, the country that actually gave birth to its forebears of disco, house, and techno, was finally crossing over into wider American culture. EDM-sampling pop tracks from acts like the Black Eyed Peas and Pitbull were topping the charts. Guetta was collaborating with the likes of Nicki Minaj, Usher, and Rihanna. A record-breaking 165,000 people were officially counted for the festival, about twice as many as had attended Coachella that year.

It all felt like a self-congratulatory celebration of the genre's recent success and an anointing of Avicii, then just 23, as the warrior prince and conquering hero the genre needed. The young Swede, blessed with elfin good looks, had the potential to be a true crossover star for the genre. The kind of figure would could feel equally at home behind the decks in Ibizia and, in poster form, on the bedroom walls of teenage girls in the Midwest. He was a wunderkind who could create records with mass appeal without the help of a pop star feature.

EDM is not an especially subtle genre, and the point was practically beleaguered when Avicii's set was preceded by a short video celebrating the genre's success and a surprise appearance by none other than Madonna. The Queen of Pop was there to introduce, and coronate, the prince of EDM.

It was a massive career peak for an artist who just a few short years earlier was a teenager glued to a computer in a Stockholm bedroom exchanging bits of songs he was working on with online friends.

So, how did he go from laptop geek to genre superstar to the man whose death at the age of 28 today caused worldwide mourning?

Avicii was born in Stockholm, Sweden in 1989 as Tim Bergling, the son of Klas Bergling and veteran character actress Anki Lidén, who in 2010 would win the Swedish equivalent of the Oscar for her supporting role in a film called Glowing Stars. He grew up comfortably in an artistically inclined household, and has said music was always part of his life growing up. His dad was a big fan of Ray Charles, but as a teen Bergling discovered house music and began obsessively following blogs for the latest news and releases of his favorite acts. It wasn't long before he procured production software for himself and began noodling around. He signed up for the online message board on the website of Dutch-Filipino DJ Laidback Luke, and exchanged techniques and bits of tracks he was working on with fellow members. Some would also later go on to great success. Future DJ superstars like Afrojack and the Bingo Players were among the members. Yes, while punk had CBGB, a certain guard of EDM luminaries had an online forum.

Bergling chose the artist name of Aviciii (from the Buddhist term for the lowest level of hell) after discovering that someone else with his real name had already secured the MySpace URL. He began posting links to his tracks in the comment sections of those house music blogs. A track called "ManMan" had begun to get some buzz, and he eventually caught the attention of club promoter Ash Pournouri. At 18, he agreed to grab coffee with the promoter hoping to get a chance to play an actual club, but when the promoter realized Bergling had boy-band-ish good looks to match his burgeoning talent, he had grander plans.

"He started saying all of these things like, 'I'm going to make you the biggest artist; we're going to get there in two years; you're going to be bigger than that guy and that guy,' " Avicii told GQ in 2013.

There was just one problem: He had to actually learn to DJ first, a completely different skill from producing tracks. Though Bergling got around this by preprograming most of his sets in advance—a technique looked down upon by club music purists, but that would become necessary for festival main stage DJs whose sets had to sync up with lighting designs, pyrotechnics, and dancers anyway.

Besides, it was Avicii's own music that rocketed him to superstardom. His original instrumental "Bromance" became a hit in his native Sweden and Belgium in 2010. A few months later he tacked on vocals taken from another song and rereleased it as "Seek Bromance." It went on to become a top 20 hit in five countries, including the U.K. and Australia. From there it was a runaway tear toward success, and less than two years later he was standing on that stage with Madonna. Pournouri had been right. He was the biggest artist in the genre. New collaborators included not just Madonna, but Lenny Kravitz and Leona Lewis. He could take home $250,000 for a single night of work.

By the time Avicii returned to Ultra in 2013, an entire historic Art Deco hotel on South Beach was rebranded as the Avicii Hotel. Suites were named after his hit songs, cocktails were created in his honor, and accommodations for the weekend cost guests up to $7,300. Avicii was once again slated to play the main stage, and after about an hour of electronic music, the stage went dark, and when the lights came back up again Avicii was standing before a live band. They played country music. Literally. It is impossible to confirm, but it very well was likely the firs time a banjo had ever been played on the main stage of Ultra or any other dance music festival before.

Pitchfork noted the event invited "comparisons to Spinal Tap Mark II: Jazz Odyssey," while EDM site Dancing Astronaut reported that "fans on site shrugged off the main stage performance and either took a seat to relax or moved around to dance" at one of the other festival stages. The controversy was like Bob Dylan's electric guitar performance at the Newport Folk Festival, but in reverse.

As with Dylan, the risk paid off for Avicii in the long term. It was the night he premiered new song "Wake Me Up" that featured singer Aloe Blac. A year prior, he had been charged with being the man to bring EDM fully into the mainstream. That year he delivered. It's just that no one at the festival really understood it yet.

"Wake Me Up" would go to be Avicii's biggest career hit. It not only easily rocketed up to the top of Billboard's Hot Dance/Electronic Songs and Dance Club Songs charts, but it topped the Adult Top 40 and Mainstream Top 40 charts as well. It was 14th on the R&B-skewing "rhythmic" chart, fifth on the adult contemporary chart, and fifth on the rock airplay chart as well. It reached the top of the charts in 22 different countries, and is still Shazaam's most-looked-up song of all time. Another country-infused track, "Hey Brother," which features vocals from bluegrass singer Dan Tyminski, proved a worthy commercial followup. In subsequent interviews, Avicii stressed that he wanted to be known as a musician more than as an EDM DJ. Even then he shrugged off the idea he was even doing anything innovative, and likened the success of the track to that of the novelty group Rednex's 1995 hit electro version of "Cotton Eye Joe."

Another year went by, and once again Avicii was scheduled to headline Ultra. But a day before what would have been his third performance at the festival he was hospitalized in Miami with what the Miami Herald said was "severe abdominal pain, nausea and fever from a blocked gall bladder." He was suffering from acute pancreatitis that had been brought on in part by years of hard drinking on the road, and ended up having to have both his pancreas and gall bladder removed. Months of gigs were cancelled so he could recover, and he'd return to the festival in 2015. Though a few days after playing the festival in 2016 he announced that he'd be taking the rest of the year off from all live sets. He went back on that promise to play a single gig later that year in Ibiza, but then announced he would retire from touring and live performances completely.

“To me it was something I had to do for my health,” he told Billboard. “The scene was not for me. It was not the shows and not the music. It was always the other stuff surrounding it that never came naturally to me. All the other parts of being an artist. I'm more of an introverted person in general. It was always very hard for me. I took on board too much negative energy, I think.”

"'It's been a very crazy journey. I started producing when I was 16. I started touring when I was 18. From that point on, I just jumped into 100 percent,” Avicii recalls. “When I look back on my life, I think, Whoa, did I do that? It was the best time of my life in a sense. It came with a price—a lot of stress, a lot of anxiety for me—but it was the best journey of my life.”

The kid who fell in love with dance music before he ever entered a club, who honed his craft alone in his bedroom on a computer, and was told he could become the biggest DJ in the world even before he actually knew how to DJ, had returned to his roots.

Indeed, new songs did continue at a steady pace. The EP Avīci (01) was released in August 2017. "Lonely Together," a collaboration with Rita Ora, didn't make much noise in America, but was a hit in most of the rest of the world. His Instagram portrayed a seemingly happy life of hiking with his dog in California and noodling in the studio with guitars and pianos.

Though his health struggles had been well known, it was still a shock when his management announced he had been found dead in Muscat, Oman. No cause of death was given. He was 28. This month also marks the ten-year anniversary of the label release of his first professional single, "ManMan."

Related: Celebrities Mourn Swedish DJ Avicii