The release of Spider-Man: Far From Home marks the first time that Jake Gyllenhaal has starred in a superhero movie. Long before he was cast as Mysterio, Gyllenhaal had been linked with the roles of Batman and even Spider-Man throughout his career.

In fact, he came extremely close to portraying the Web-Head in Sam Raimi's Spider-Man 2. Yes, you read that right; Gyllenhaal almost replaced Tobey Maguire in the sequel.

Mysterio in Spider-Man: Far From Home

According to Variety, Maguire felt he wasn't getting compensated enough for the sequel, citing the purported $30 million that producer Laura Ziskin reaped from the first film. Considering the worldwide gross of $821.7 million for 2002's Spider-Man, Columbia Pictures didn't want to lose its star and resolved the issue with Maguire's representatives -- or so the studio thought.

Right before production was set to begin, a statement from Maguire's spokeswoman threw a spanner into the works. "After doing two physically demanding films in a row, Tobey has experienced mild discomfort in his back, which is in the final stages of healing," the statement read. "With an April 12 start date around the corner, everyone involved wants to be certain he is able to do the intense stunts."

RELATED: Movie Legends Revealed: Did Doc Ock and Mary Jane Nearly Date in 'Spider-Man 2'?

The studio wasn't enamored with Maguire's behavior, believing his reported back problems were being used as a threat during negotiations. Especially since the studio had been accommodating enough to push the production date of Spider-Man 2 from January to April to allow Maguire to finish the film Seabiscuit for rival studio Universal.

Spider-Man 2 Tobey Maguire

Not willing to jeopardize the 2004 release date and irritated by the star's behavior, the studio decided to move forward without him. The executives informed Maguire that they'd proceed without him, because of his back issues, and reportedly made an offer to Gyllenhaal, who was dating Maguire's co-star and ex-girlfriend Kirsten Dunst at the time. The studio denies any deal was struck, but there are others who confirm its existence.

It made sense, too. While Gyllenhaal wasn't the mega-star he is at the moment, he'd picked up major momentum with his performances in films such as Donnie Darko and October Sky. Furthermore, he fit the mold to play Spidey: lean, boyish and with an air of vulnerability that Maguire had become famous for. In many ways, he was the picture-perfect replacement.

Realizing the extent of what happened, Maguire was shell-shocked. "I never understood that we were at that point," he revealed to the Los Angeles Times. "There was a period where I didn't know what I could do to work it out. I felt a little bit at a loss."

spider-man-tobey-maguire

It was Maguire's future father-in-law and Universal's president at the time, Ronald Meyer, who pulled all the strings and contacts he had to get him back onto the production and in Columbia's good books. Provisions were put into Maguire's contract and the official statement was that "the studio was worried about his back," but that's most likely the PR-friendly version of events.

Of course, this left Gyllenhaal out in the cold. He'd apparently started training for the role only to find out that Maguire was back in the picture with his tail between his legs and promising to be on his best behavior.

RELATED: This Spider-Man 2 Fan Definitely Won New Year's Eve

But, hey, things didn't turn out too badly for Gyllenhaal, as he's had quite the career since then and continues to be one of the most in-demand actors in Hollywood. Additionally, this whole incident was parodied in Entourage, where Gyllenhaal replaced Vincent Chase in Aquaman 2.

At least Spider-Man: Far From Home is Gyllenhaal's opportunity to finally star in a Web-Crawler film, even if he isn't portraying the titular character. Still, it's an interesting what-if scenario to consider how different Spider-Man 2 could've been.