History will remember late actor Sean Connery as one of the manliest actors ever to grace the silver screen. But while there was no one better to play the role of the alpha male in an action movie, Connery did not mind dipping his toes in other genres as well. In an interview, filmmaker Terry Gilliam revealed how his cult-classic fantasy adventure movie Time Bandits was saved thanks to Connery's involvement.

When Terry Gilliam and his writing partner Michael Palin set out to write Time Bandits, they included a scene where the character of King Agamemnon is revealed to be Sean Connery. The scene was only meant to be a joke since they never once believed the James Bond actor would accept the role. Fortunately, influential manager Denis O'Brien brought the scene up while playing golf with Connery, and the actor responded with enthusiasm.

RELATED: Time Bandits TV Show in the Works with Terry Gilliam
"[Denis] mentioned the possibility of being in this film, and Sean liked the idea. I guess he was a [Monty] Python fan. I'm convinced the reason he said yes was that he was having some guilt feelings about having been an absent father. And here was a chance to be a surrogate father."

Time Bandits tells the story of eleven-year-old Kevin, an imaginative child who loves to learn about history. A chance encounter with a group of dwarves wielding an enchanted map takes Kevin on a whirlwind journey through time. Aside from meeting a host of famous figures from history, Kevin is temporarily adopted by King Agamemnon, played by Sean Connery.

According to Gilliam, the demands of the story he had undertaken to craft into a movie were proving overwhelming for him on set in Morocco, until Sean Connery stepped in to lend a hand.

"He literally saved my ass. Sean looked at my storyboards, and says, 'Forget about that, you've not gonna get this done, kid. So I started throwing pages out. Anything he said, it was 'Yes, sir.' I suddenly felt like I was in the hands of an incredible actor with great experience. And we got through that first day thanks to his pragmatism and not my ambition."

On Connery's advice, Gilliam pared down his overly-ambitious script into something that could be shot in time and on budget. This also included entirely removing a scene where Connery was supposed to mount his horse, which the actor was convinced would not look good.

The end of Time Bandits saw Connery making a brief appearance as a fireman, to leave the audience wondering if the whole adventure had been a dream. Gilliam says that scene was added upon Connery's suggestion, and filmed hastily in a single day in England, with the crew working around the actor's busy schedule.

"[Connery] was back in England for, I think, a day meeting his accountant. And I managed to get him to come out the middle of nowhere to just put on a fireman's helmet, wink and get in the truck and go, and that was it. And it ended up this brilliant ending that wouldn't have been there if it hadn't been for Sean and his tax problems."

Sean Connery passed away this past weekend. This news first appeared at The Hollywood Reporter.

Neeraj Chand