Westworld” was nominated for 22 Emmy Awards on Thursday, making it and “SNL” the most-nominated shows of 2017. The Television Academy’s recognition comes as welcome relief, given the show’s long path to the screen.

The series is based on the 1973 film of the same name, which was directed and written by “Jurassic Park” scribe Michael Crichton and starring by Yul Brynner. The TV version of “Westworld” was first ordered to series in November 2014 (the pilot was greenlit in 2013), with the target of a 2015 premiere date.

At the Variety TV Summit in June, series showrunner Jonathan Nolan told the story of how executive producer JJ Abrams first approached him to join what was now to be a television series.

“JJ had actually sat down with Michael Crichton 23 years earlier to talk about a reboot for the movie version of [‘Westworld’],” Nolan said. “JJ hadn’t quite figured out how to remake it as a film, so in his way he sat on it for 20 years and called [Lisa Joy and I] and said, ‘You can do something really special with this.’”

But the production was far from smooth. The series found itself embroiled in controversy long before it aired when it leaked in 2015 that background actors in the series were asked to sign a document that could require them to simulate graphic sex acts, as well as “perform genital-to-genital touching,” among other things. SAG-AFTRA intervened and HBO revised the document, with the premium cabler asserting that Central Casting had written the original version.

Then in January 2016, Variety exclusively reported that production on the series had been temporarily shut down. HBO said that the shut down was to allow Nolan and Joy a chance to catch up on writing the final four episodes of the series. The series was originally scheduled to wrap in November, but would not resume production until March of that year.

And given the show’s reported budget of $100 million for the first 10 episodes, there was no doubt some hand-wringing at the network when the show finally launched on Oct. 2, 2016.

But the drama became a massive hit, drawing critical acclaim and strong ratings. “Westworld” averaged 11.7 million viewers per episode across multiple platforms according to HBO, the most ever for a freshman drama. What was even more stunning, though, was the fan engagement: Given the show’s complex storylines, fans took to sites like Reddit to offer up their best theories and dissect every minute detail in each episode.

“I’ve been thrilled with the performance of the show from a ratings standpoint, from a critical standpoint,” said HBO Programming president Casey Bloys in December 2016. “And what’s been really nice has been the fan engagement — the fan theories, the social-media interaction, the think pieces. All of this shows that ‘Westworld’ is really getting into the popular culture.”

Despite a rocky start, HBO’s faith in the series paid off in spades. The network renewed the series for a second season shortly after it premiered, with Season 2 expected to launch in 2018, though no official premiere date has been announced.