In an effort to prevent leaks, a fake script for Avengers: Infinity War was produced in which Loki survives.

As fans know, Loki is the first major character to die in the movie. He is strangled by Thanos when he attempts to get close enough to the gauntlet-wielding villain to shiv him. Yet, in the alternative script, Loki's plan was much more successful.

RELATED: Benedict Cumberbatch Reveals His Biggest Avengers: Infinity War Regret

Executive producer Trinh Tran revealed in The Art of Avengers: Infinity War that few crew members were aware of Loki's true fate until the day the scene was shot.

"We created a version of the script where Loki would get away in an escape pod at the beginning of the movie," Trinh said. "When we started shooting that particular sequence, we had crew members who were thoroughly confused. We had to let them know that those were fake versions of the script that they read."

With the popularity of the Marvel Cinematic Universe has come an insatiable fan desire for spoilers and news about plot points from future installments of the series. After enduring three leaks despite precautions, directors Anthony and Joe Russo decided to write a script with a number of fake scenes as a way to tighten security further. The fake scripts were distributed to cast and crew so the Russos could keep major story developments under wraps.

RELATED: Avengers: Infinity War Concept Art Reveals The Soul Stone's True Power

Despite the crew's confusion, Loki's alter-ego Tom Hiddleston was aware of his character's demise well before it happened. Hiddleston revealed he learned about the upcoming plot development in 2016 before Thor: Ragnorak.

Hiddleston indicated he believed his character's end brought his arc to an appropriate close. It also increased the stakes for Infinity War substantially, letting viewers know how merciless Thanos could be.

However, the MCU may not have seen the last of Loki. There are reports of Disney developing several limited series based on characters in the MCU for its soon-to-launch streaming platform. Loki was said to be one of the characters getting a series, which would see Hiddleston return to reprise his role.

RELATED: Heroes From Infinity War Who Will Come Back (And Who Won't)

The untitled sequel to Avengers: Infinity War will release on May 3, 2019. Directed by Joe and Anthony Russo, Marvel’s Avengers 4 stars Robert Downey Jr., Josh Brolin, Mark Ruffalo, Tom Hiddleston, Chris Evans, Chris Hemsworth, Jeremy Renner, Chris Pratt, Elizabeth Olsen, Sebastian Stan, Benedict Cumberbatch, Paul Bettany, Samuel L. Jackson, Cobie Smulders, Benedict Wong, Zoe Saldana, Karen Gillan, Vin Diesel, Dave Bautista, Pom Klementieff, Scarlett Johansson, Tom Holland and Anthony Mackie.

(via Screen Rant)