Photo: Clockwise from top left: HBO,Stephen Lovekin/Getty Images,HBO,Jason Merritt/Getty Images

The medieval world of Game of Thrones wouldn’t be the first place you’d expect to find rock musicians. But increasingly, members of Coldplay, Snow Patrol, and other famous bands can be spotted among the legions of troubadours and troublemakers roaming Westeros, and tunes whistled or sung by characters during various episodes are receiving closing-credits makeovers by the likes of the National and the Hold Steady. So when did the folks behind the HBO show send out raven-borne party invitations to all of these real-world rock bands? With the season-three soundtrack hitting stores yesterday, let’s take a look at how the music industry has descended on the show like George R.R. Martin obsessives on a new installment of “A Song of Ice and Fire.”

According to showrunners David Benioff and Dan Weiss, the uptick in big-name musicians getting involved with their adaptation of Martin’s books began in season two with the idea that establishing the song “The Rains of Castamere” within the world of the show would pay off enormously later. That disturbing tune, as Cersei explains to Margaery with her usual false sweetness in an episode from this past season, has a rich history; it describes the fall of an immensely wealthy family that dared to rebel against the Lannisters. “Do you know where House Reyne is now?” asks Cersei. “Gone. A gentle word. Let’s say slaughtered.” The song, known far and wide as a Lannister family anthem, serves as a warning to rival houses. But it’s also just insanely catchy. Early in season two, Tyrion whistles it on his way to the small council. Later in season two, Bronn, having learned it from “drunk Lannisters,” sings it before the Battle of the Blackwater. This past season, Thoros of Myr sings it while he wanders. And of course, it’s played at the Red Wedding, which signals to Catelyn Stark that something is terribly, terribly wrong.

All of that could have been sufficient usage of “The Rains of Castamere,” as Benioff and Weiss told Vulture in a joint statement. But they wanted to go further than just giving us snippets and instrumental versions here or there by commissioning a “full, memorable version” of the song that would act as “memorable ending” to the “Blackwater” episode in season two. With that dual purpose in mind, they “tossed around the names of a bunch of artists and bands that we liked and whom we thought would fit the tone of the song.” When Florence + the Machine declined owing to another soundtrack commitment, they turned to another top choice: the National. “When we started doing this, it was not known we would do such a thing,” Game of Thrones composer Ramin Djawadi (the man behind the show’s imitable theme song) told Vulture. “It was us saying internally, ‘Hey, it would be cool if we took this theme and had a band do it.’ We asked them, ‘This is what we’re thinking — would you guys be into it?’”

The band was. Since Djawadi had already composed the melody for “The Rains of Castamere” earlier in the season, the National was tasked with fleshing out a full arrangement during a session at his studio.”I had done my demo mock-up minus the vocal,” said Djawadi. “And then we shaped it a bit, took the instruments out, and the band did their treatment, with a cool vibe to it.” The showrunners were pleased, to say the least. “The rich mournfulness of Matt Berninger’s voice and Aaron Dessner’s understated arrangements fit perfectly with the haunting song Ramin had written,” said Benioff and Weiss. “It’s impossible to imitate Matt’s voice. Go ahead and try it — you’ll just sound silly when you drop into that register. But he sounds perfect. Every time we hear him sing ‘Rains,’ it makes us happy — in a foreboding, melancholy way.”

When season three came around, the showrunners decided to repeat their little rock experiment and go a little bolder with the song “The Bear and the Maiden Fair.” Again, they wanted a song that could end a big episode, only this time, it would be used as a jarring juxtaposition following a shocking moment at the end of the third episode (Jaime Lannister getting his hand chopped off). Their inspiration? Something any direwolf could admire: the 1981 horror comedy An American Werewolf in London. “We were thinking a bit about the way ‘Blue Moon’ was used at the end of An American Werewolf in London,” said the showrunners, “and this time, we wanted a raucous, rollicking drinking song to jolt people at the end … for the final effect.” Plus, according to Djawadi, everyone in Westeros would know the song in question. “It had to be a fun song, a catchy song,” he said, adding that the Hold Steady topped their list. “Once again, we were spoiled with our first choice!” said Benioff and Weiss.

As it turned out, the Hold Steady’s Tad Kubler had played pool with Peter Dinklage a few times in Brooklyn. He told Vulture that, despite not being a fan of the fantasy genre (he still hasn’t seen the Lord of the Rings movies, for example), he’d tuned into the show initially owing to the personal connection and was surprised to learn that he was hooked. “There’s a great line when Petyr Baelish talks about chaos as a ladder, in this intense monologue,” said Kubler. “That kind of stuff really drew me into the show.” So when Benioff and Weiss called him to ask if his band would be interested in recording a loud version of “The Bear and the Maiden Fair,” Kubler knew he wanted in — he just didn’t know what that was. “I hadn’t read the books, so I faked like I knew,” he admitted. “I was like, ‘Oh! Of course. That song.’”

During a follow-up discussion with Evyen Klean, the show’s music supervisor, Kubler asked, “Do you just want any band, or do you want my band?” He said that Klean assured him the producers were genuine fans of the Hold Steady. “That appealed to my ego,” said Kubler. “So of course I was like, ‘Sure, we’ll do it. Great. Awesome.’” At that point, Kubler felt compelled to admit that he wasn’t familiar with the song and asked the Game of Thrones bigwigs to explain what they wanted. “I think ‘drunken’ was the word they used,” he said. “Like ‘drunken Pogues.’”

When Benioff and Weiss got the final version of the Hold Steady’s “The Bear and the Maiden Fair,” they were sitting with George R.R. Martin in Santa Fe, and played it for him on their laptops. “Before the second line was sung, we were all beaming over how great it was,” the showrunners said. “By the time the song was over, we’d already finished a bottle of tequila.” Kubler chuckles when he recalls the feedback they gave him. “They told me that they were dancing with George R.R. Martin,” he said, “so I assumed it involved something like a bottle of tequila.”

As thanks for contributing the song, Benioff and Weiss told Kubler that he could come to Belfast and make an appearance on the show — a not-unheard-of notion in the wake of the cameos done by Gary Lightbody from Snow Patrol and Will Champion from Coldplay. (At a recent event, Benioff explained to Vulture that both happened because the musicians asked nicely: “Gary came to visit the set because he lives in Northern Ireland — he asked us if he could just come on. And Will came to us and asked the same thing, and we said, ‘Of course! We need a drummer for a big scene.’”) It’s the first time a musician has been invited to appear on the show. “They said, ‘We’ll give you a sword, and put you in a hallway somewhere,” Kubler said. “But I’ll see if they can write a cameo for us where we’re playing in a pub, and I’ve got a mandolin, which is one of my least favorite instruments, but hey.”

With the precedent now set, expect more bands to be incorporated into Game of Thrones in seasons to come; they’re already fielding offers from a flood of indie-rock and alternative artists who have expressed interest in contributing, including Soundgarden, Garbage, the Shins, Band of Horses, Sun Kil Moon, and Portugal. The Man. “Once I started having these conversations, people came out of the woodwork,” said Klean. “Bands, managers, labels are calling me all over the place, ‘What about this? What about these guys?’” Of course, the allure of HBO money is likely driving some of the outreach by the music industry, but the showrunners maintain the music and cameo appearances will continue to serve the story, not the other way around. Klean said, “We’re not chasing bands because we think they’re big bands, like, ‘We have a bunch of money. Can we get you to do this for us?’ It’s not about the money. It’s about doing something cool for the show.”

“Obviously, there’s no place but at the end credits to stick [these songs] into the show, but it’s an ongoing playground,” said Djawadi. “Depending on how the episode ends, whatever that last scene is, there can always be something new.”