One of the most iconic episodes of the iconic sitcom The Office is the Season 6 episode “Niagara,” in which Jim and Pam finally tie the knot. John Krasinski and Jenna Fischer’s will they/won’t they romance was the beating heart of The Office for the show’s first few seasons, and they finally got together in Season 4. And by the sixth season, it was time to take their relationship to the next level with a wedding set at Niagara Falls, with the entire office making the trek to, of course, wreak havoc on the occasion. But if you think “Niagara” goes off the rails as-is, wait until you hear about the original version of the episode that featured the return of Roy and a horse falling into the gigantic waterfall.

The Office showrunner Greg Daniels and writer/star Mindy Kaling co-wrote “Niagara” and they enlisted veteran Office director Paul Feig to take the helm. And as written, the story was pretty much the same up until the wedding day, which was originally supposed to be interrupted by Pam’s ex Roy (David Denman) as told in Andy Greene’s recent book The Office: The Untold Story of the Greatest Sitcom of the 2000s. Feig broke down the original Roy story twist:

“Originally, it was supposed to be that Pam and Jim are in the middle of the ceremony and Roy has been haunting around and regretting that he let her go and wanted her back. When they were in the middle of the ceremony, it was supposed to be that Roy rides into the church on horseback dressed like a white knight to win her back.

the-office-niagara-jim-pam
Image via NBC

Producer Randy Cordray explained that Roy thought Pam still loved him:

“Roy had decided that this whole episode with Jim was really just Pam trying to make Roy jealous to get her back. He thought Pam was really in love with him all along and that he needed a grand gesture to get her back. And so in the story outline, Roy goes to a horse-rental facility, a stable, and rents a beautiful white horse… When she turns around he sees that she’s pregnant and he realizes, ‘Oh, I am deluded. This is crazy. She doesn’t want me, she wants Jim. She’s having a baby with Jim.’ And he would slink away in disgrace.”

In addition to this Roy twist, there was also a subplot in which Dwight (Rainn Wilson) had a genetic obsession with throwing himself over Niagara Falls, Feig recalled:

“Greg came up with an idea where Dwight has an obsession with the falls and some sort of suicide gene to go over them. He fights it the whole episode.”

So when Roy came outside with the horse, Cordray explained that he was then supposed to hand it off to Dwight:

“Dwight Schrute, horseman and beet farmer that he is, would then come along after the wedding. He’s walking outside the church and he sees Roy despondent, sitting on the curb, holding the reins of the horse. And he says, ‘Tough luck, buddy, that didn’t work out like you wanted it, did it?’ And Roy would be, ‘No, and I’m stuck with this stupid horse. I paid for the horse for the rest of the day.’ And Dwight says, ‘Hey, I’m a horse person. Let me take care of it.’ He takes the reins of the hose and he’s taking it ostensibly back to the stables, but Dwight somehow finds himself riding along the banks of the Niagara River.”

the-office-niagara-dwight
Image via NBC

And so as the wedding progressed, Dwight would be riding this horse closer and closer to the falls, until the horse jumps over the falls just as Jim and Pam are having a romantic moment on a boat. Cordray continues:

“They’re riding through the white water of the river and Dwight realizes he’s gotten too close to the edge of Niagara Falls and the horse is looking fearful and Dwight is looking fearful. Dwight finally realizes he’s gotta bail off the horse and swims safely to shore. We cut to Jim and Pam having a romantic moment on the bow of the Maid of the Mist boat, and in the background we see this white horse go tumbling over Niagara Falls, plunging six hundred feet.”

Which, uh, is kind of insane. And as Feig recalls, many of The Office writers weren’t crazy about this idea:

“I remember all the writers were coming to me like, ‘We can’t do this. You can’t kill a horse. It’s crazy.’ Everybody was all over Greg, and Greg was just like, ‘I’m telling you this is going to work.’ He was digging in and everybody was freaking out about it.”

One thing that made The Office stand out was its commitment to naturalism, from the cinematography to the way the characters interacted to the lack of fancy costumes and makeup. That also extended to the show’s humor, which was wonderfully relatable. And writer Brent Forrester recalled that some writers felt this joke was violating Greg’s own rule about the grounded nature of the show:

“Greg just thought this was super funny. I think many people felt that it was in violation of his own rule of keeping the tone naturalistic, a horse going off the falls. They fought him, many of the writers, aggressively on this.”

the-office-niagara
Image via NBC

Not all the writers were against it. Warren Lieberstein says in the book that he thought Greg could have made it work. But the real turning point was after the table read, when Steve Carell said he thought the joke was a mistake. Cordray recounted the experience:

“A week in advance of going to Niagara Falls, we had our table read for that episode. The network is there and the studio is there. The actors all read the parts, the director reads the stage directions out loud, and then afterward, the network and the studio give a few notes, and then you are left with just the writers to discuss the episode. Steve Carell stays behind because he is a producer on the show and he has some say over the writing of the show. Steve was the first one to speak up. He said, ‘Guys, I love the episode but you can’t throw a horse over Niagara Falls.’ And Greg and Mindy [Kaling] were like, ‘Really? But it’s so funny.’ And he’s like, ‘Yes, it’ is funny. I love your writing. I love all of you, but this is really an animated joke. This is a cartoon joke. This is a joke we might see on The Simpsons. I know many people think that The Office has already jumped the shark in many different ways, but let me just say, throwing a horse over Niagara Falls is really jumping the shark. I’m not in favor of this.’ And with that, he took his leave and we were left to discuss it.”

And as Feig remembers, Greg finally gave in:

“Everyone just attacked Greg so much that he finally very angrily said, ‘All right, forget it! We’re not going to do it!’”

the-office-niagara-dance
Image via NBC

In hindsight, however, Daniels said, “Luckily, I was persuaded not to do [it],” so it sounds like he now understands the joke would have been a mistake. But now the production faced a different problem: with only a week to go, they had to rework the whole episode and create a new subplot for Dwight.

As we now know, “Niagara” finds Dwight hooking up with Pam’s Maid of Honor and Roy is nowhere to be seen in the episode. And as for the big dance number during the wedding that’s now iconic, the writers were inspired by watching a viral YouTube video and decided it would be a good fit.

On the plus side, nixing the horse stunt meant that the show had the budget to actually fly Krasinski and Fischer out to Niagara Falls—something that Cordray recalls the studio originally didn’t want to do:

“When I prepared the budget, one of the comments from the studio was, ‘You’re not taking John Krasinski and Jenna Fischer to Niagara Falls. You can go there and shoot on the Maid of the Mist, but you’re gonna shoot them in a digital composite here on a stage in Hollywood and you will plant them on the front of that boat. We’re not spending plane tickets and hotel fare and putting our actors out on that boat. You’re gonna digitally composite that.’ Well, I knew that was gonna look like crap. I knew creatively that we had to have John Krasinski and Jenna Fischer actually getting wet under the spray of the actual Niagara Falls on the actual Maid of the Mist. I was not about to give that up. When the horse went away, I knew we could do it. I knew we had the money to do it.”

All’s well that ends well, and ultimately this is fascinating insight into the collaborative nature of The Office writers’ room. Daniels is certainly responsible for setting the tone of the series and keeping it on track throughout his tenure—and is also behind the key change that made Michael Scott likable—but even sometimes the most talented writer/producers can get hung up on a joke or idea that’s just plain wrong.

It’s also worth noting that while the writers and Carell dug in their heels on the cartoonish nature of this joke, when Daniels exited showrunning duties to co-create Parks and Recreation, it did feel like The Office seasons 7 and 8 veered a little too far into that cartoon-y territory. Then when Daniels returned to showrun the final season, things came back down to earth a bit in Season 9.

For more fascinating The Office behind-the-scenes stories, pick up Greene’s book and check out our articles on the real reason Carell left the show, the secret meaning behind the talking head interviews, and why “Office Olympics” is one of the show’s most important episodes.