Exploring the prison cells of West Virginia Penitentiary was just another day in the life for Bill Skarsgard while filming Hulu’s new Stephen King-inspired series “Castle Rock.” While the horror veteran doesn’t scare easily when working with spooky material, carvings on the cell walls and a long history of executions made for a chilling atmosphere.

“There are all these old stories about terrible things that happened, and there was something in the air that was very eerie about that place,” Skarsgard tells Variety. “It was great for my character and everything to be in that sort of environment. I was like, ‘You would be freaked to spend a night in this place by yourself.’”

The penitentiary set was integral to Skarsgard’s “Castle Rock” character, who is a mysterious inmate at Shawshank State Prison. Shawshank is just one of many King easter eggs scattered throughout horror series, which is based broadly on the author’s body of work set in the fictional town of Castle Rock. Though he’s never met the suspense writer, Skarsgard is no stranger to the King thriller sub-genre. Last summer, his breakout role as Pennywise the Dancing Clown in a remake of King’s “It” lured millions into theaters, recording more than $700 million at the global box office.

After “It,” Skarsgard wasn’t certain he wanted to continue on the King track when the “Castle Rock” team approached him. He had just wrapped production on the film at the time and was ready to remove the clown shoes and take a break from King’s shop of horrors.

“I was a little bit reluctant going into it,” he says. “I didn’t get to read the script, and it was like a two-sentence description of the character, and I didn’t know what the show was about or who the character was or whatever. All I knew was that it was kind of Stephen King-connected, and just because I had just finished ‘It,’ I was like, ‘I’m not sure I want to do something — whatever this is — that’s so close to what I just did.’”

But a later pilot reading with “Castle Rock” creators Sam Shaw and Dustin Thomason allayed much of Skarsgard’s concerns. Though both “It” and “Castle Rock” had King in common, the similarities seemed to stop there.

“They didn’t tell me everything, but they told me enough,” Skarsgard says. “Going into it was a bit of a concern, but the material and the project itself just convinced me, and it was very clear it was completely different than what I just did.”

Though more familiar with his character and the plot, Skarsgard still found himself putting a certain amount of blind faith in the creators, who opted to keep some details of the story a mystery when “Castle Rock” began production. Limited knowledge of his character’s trajectory made for a much different experience compared to filming “It,” which had a complete script and plenty of accessible source material.

“That was weird for me to start shooting something I actually didn’t know how it was going to end or really where my character was going,” Skarsgard says. “It was important for me to know everything that my character new at any given point.”

Whenever Skarsgard felt less prepared to approach a scene, he reached out to the writers to glean as much information as possible about the Shawshank prisoner’s mindset and motivations.

“I needed to know that,” Skarsgard says. “That’s always different when you work on a film, and ‘It’ was based on a book, so not only is it a film, but you also know the book — we had the book; we know exactly how it ends.”

While he didn’t have quite as much material from which to draw for “Castle Rock,” Skarsgard was able to rely on the experience he gained starring in a feature film also set in the King universe when molding his character.

“‘It’ was so particular, and the character was so particular, it was a very daunting task,” Skarsgard says. “I committed to really big and bold choices, and thankfully it paid off, and there was something about that that was giving me a little bit more confidence.”

Some of those “bold choices” included crafting Pennywise’s bone-chilling speaking voice. In a Variety podcast, Skarsgard detailed his process creating the clown’s maniacal tone, which involved forcing himself to burp when delivering each predatory line.

“In ‘Castle Rock,’ which I did right after, I was like, ‘Alright, I’ll commit to more things and maybe be bolder in my choices,'” Skarsgard says. “It’s one of those things where, if it pays off, it’s great, and if it doesn’t, it’s terrible, but I think it’s a good toolkit to have in your arsenal.”

Regardless of his hesitation to return the King realm for “Castle Rock,” Skarsgard is willing to entertain the possibility of appearing in more King adaptations. Next up is the sequel to “It,” which Skarsgard will begin filming in a couple of weeks.

He’s one of — if not the most — prolific writer that we have, so there’s no shortage of great material,” Skarsgard said. “That’s ultimately how I pick roles and jobs — if the material’s good.”

“Castle Rock” premieres Wednesday, July 25 on Hulu.