When the writers of The Office wanted the characters Jim Halpert and Pam Beesly to break up in season 9, John Krasinski stepped in to save them, according to Fox News.
Author Andy Greene revealed in his book The Office: The Untold Story of the Greatest Sitcom of the 2000s that the show's creator Greg Daniels wanted to break up Halpert and Beesly with a cheating scandal, according to Collider.
The characters' relationship was revealed in season 4. One of the show's writers Owen Ellickson shared the alternate ending in the book.
Halpert and Beesly's relationship was under strain when he took a job in Philadelphia in season 9, while Beesly took comfort from a new character Brian.
Ellickson revealed he'd planned that Beesly and Brian would "hook up a little bit".
"Ultimately, I don't think it was about actually going there," he added. "They never did anything. It was just to introduce worry in the audience."
But Krasinski, who played Halpert, stopped the plot from moving further in that direction.
Writer Brent Forrester claimed they "pulled the ripcord" on it because it was so painful for fans of the show.
"John Krasinski said to me, 'Brent, this final season is for the ultra fans of the show. They're the only ones really still left watching, right? This is for them. Jim and Pam splitting up is too painful for them to sustain all the way to the reunion. We have to get them back together immediately'.
"I was like, 'Wow, we can't allow this beautiful couple to really be like on the verge of divorce. It's too awful for them.'"
Halpert and Beesley got married in season 6 when Beesley found out she was pregnant. Jenna Fischer, who played Beesley, was pregnant in real life and it was written into the script.
When the show finally came to an end after 9 seasons, the characters were happily married with two children.