As fans prepare for the release of Star Trek Beyond, a crazy story about the 1979 movie Star Trek: The Motion Picture has had us all reflecting on the franchise’s colourful history. An extract from new book The Fifty-Year Mission: The Complete Uncensored, Unauthorized Oral History of Star Trek, published by The Hollywood Reporter, has revealed how Star Trek: The Motion Picture nearly featured Captain Kirk punching Jesus.

William ShatnerWilliam Shatner played Captain Kirk.

In a draft of the script written by series creator Gene Roddenberry in 1975, the film would have ended with Kirk encountering an alien who had assumed the image of Jesus Christ and getting into a fist fight with him on a bridge.

Director Richard Coller explained: “The Enterprise went off in search of that thing from outer space that was affecting everything. By the time they got into the alien’s presence, it manifested itself and said, “Do you know me?” Kirk said, “No, I don’t know who you are.”

More: William Shatner Teases 'Star Trek: The Musical' For Franchise's 50th Anniversary

The alien then shape-shifted and into the form of Christ and Kirk told him “Oh, now I know who you are.” The script was rejected by Paramount’s head at the time Barry Diller, who was a devout Catholic, but it soon became something a legend.

Years later Michael Jan Friedman was hired to adapt the unmade screenplay into a novel to be called The God Thing, but was shocked to read just how out there Roddenberry’s original idea was.

“When I read the material, I was dismayed. I hadn’t seen other samples of Gene’s unvarnished writing, but what I saw this time could not possibly have been his best work. It was disjointed — scenes didn’t work together, didn’t build toward anything meaningful,” he said.

More: Zachary Quinto Pays Tribute To Late 'Star Trek Beyond' Co-star Anton Yelchin

“Kirk, Spock and McCoy didn’t seem anything like themselves. There was some mildly erotic, midlife-crisis stuff in there that didn’t serve any real purpose. In the climactic scene, Kirk had a fistfight with an alien who had assumed the image of Jesus Christ. So Kirk was slugging it out on the bridge. With Jesus!”

Stark Trek: Beyond, the thirteenth film in the sci-fi franchise, will hit theatres on July 22. It stars Chris Pine as Captain Kirk and Zachary Quinto as Spock, along with Zoe Saldana, Idris Elba and the late Anton Yelchin.