Parks and Recreation type TV Show network NBC

(SPOILER ALERT: Do not read until you have seen “Two Funerals,” the Tuesday-at-8:30-p.m. episode of Parks and Recreation.)

For years, fans of Parks and Recreation have been dying to catch a glimpse of Mayor Gunderson. When they finally did, he was dead. And it was love at first sight.

Viewers who tuned in Tuesday night to the soon-to-be-dearly-departed comedy were treated to a heavenly shock in the lifeless form of Bill Murray. A character whose name was first uttered in season 2, Mayor Walter Gunderson had grown into somewhat of a fabled figure—sporadically referenced, never spotted—and there was a plan for him to forever remain an unseen mystery. But when a certain eccentric film star/comedy legend/bachelor party crasher agreed to pop into Pawnee and play dead (and apparently Ethel Beavers’ secret lover), a few adjustments were made, as was everyone’s day. How huge of a tiny surprise was this for Parks? “It’s such an unexpected thing, and it’s a thing we never ever really thought was going to happen, so it’s about as big as it gets,” executive producer Michael Schur tells EW. “It’s something that we were dreaming about for so long.”

The journey to cast the mayor was an unconventional one, and not one that Schur & Co. were necessarily going to take. They were thinking that it might be funnier to never show Gunderson’s face… unless they found someone truly special for the role. Early in season 3, one name that got tossed around a bit was—brace yourself for this curve ball—Arnold Schwarzenegger. Former Parks star Rob Lowe was friends with the then-Governor of California and reached out to gauge his interest in a guest spot. (“We were going to have him on the show and never explain why he had an Austrian accent,” notes Schur.) Alas, Schwarzenegger told the Parks team that he couldn’t take the role while still in office. “He was very nice about it, and he really wanted to do it, but it just couldn’t work,” says Schur. “So at that point we were like, ‘Just forget it. It’s cooler to mention the mayor but never see him.’ And around that time, we said internally that the only way that we would ever do it was if we got Bill Murray. I don’t know why—that became the thing. Maybe he was transitioning into being more myth than man at that point.”

From then on, the cast and producers would joke about it in interviews. During a Late Night with Jimmy Fallon appearance in 2011, Amy Poehler announced that she would pay him $250 for his services. “There was no attempt really to lure him—we just kept saying it loud,” says Schur. “Aubrey [Plaza] met him somewhere and said, ‘You should be the mayor on our show,’ and he was like, ‘What are you talking about?’ Amy knew him a little bit and saw him somewhere and said the same thing. And then last year, Aubrey fell into his circle in the film world and started working really hard at hooking him. Then Amy chimed in and Rashida [Jones] chimed in and at that point, I think honestly what happened is he started watching the show.”

Schur tried not to get his hopes up, though. As he and the writers worked on the episode in which Mayor Gunderson dies (paving the way for another startling development: Interim Mayor Gergich!), they plotted jokes that would obscure his identity, beyond a closed casket ceremony. “You know when someone gets pregnant in a TV show and her belly is cleverly blocked by plotted plants or grocery bags?” says Schur. “We were going to have posters all over the place that said, ‘We remember Mayor Gunderson,’ and there would always be something blocking his face.” Meanwhile, Plaza and Poehler reached out to the elusive actor one final time. “Aubrey and Amy were like, ‘This is your last chance. The mayor’s dying. Do you want to come lie in a coffin? It would be really funny,’” recounts Schur. “And they [told me], ‘I think it might work.’ Soon after, Schur received a simple voice mail from Bill Murray that said: “Hey, this is Bill Murray. I hear you might have some dead work for me.”

While the few people who knew about it remained cautiously pessimistic that it would really pan out, Murray did indeed report for duty on the Parks set one day in November. The memorial service scene had already been filmed without him, but the producers arranged to reshoot part of it with him as the deceased man of the hour (and kept the whole thing under the tightest of wraps). “Once he had agreed to do it, we thought: The coolest possible thing is just to have him lying in the coffin. That’s the artistic choice,” says Schur. “But if you’ve got that guy around, you might as well as try to get him to say something out loud, right?” And so the writers added his video message that would be played at the memorial. Murray was given about 30 options to read. “He did every single one of them, one after another, and then he improvised two complete ones by himself,” praises Schur. “The one in the show is one that he used a tiny bit of what we had written and then it’s an improv from Bill Murray, which is so cool.”

As brief as his appearance is, Murray made the most of his time on the set. “He was just the most delightful person,” reports Schur. “Not only was he incredibly complimentary of the show, he went around to every one of the actors and told them how great they were and cited specific episodes and moments. He hung out on the set for three hours, watching us shoot the show.”

Murray is yet another impressive comedy name on Parks’ ever-expanding guest roster, which has become a point of pride for the folks behind NBC’s small-town-government series. “One of my favorite things about working on this show has been the guest stars,” says Schur. “It’s one of the things I’m proudest of, and Amy would say the same thing. So many funny people have been on the show and it really makes me happy to think that on some level, that will be the legacy of the show, that it was a place where funny people just came and hung out.” Of course, this one ranks extremely high on the list. “Part of what makes it so fun to have [Murray] on the show is that he is this kind of citizen of America,” says Schur. “He doesn’t have the same kind of existence that humans have. It felt very fun and special to have him be a part of our world for a day.”