Tobey Maguire was the first actor to play Peter Parker/Spider-Man in the character’s first big-screen adventure, but he was almost recast when Spider-Man 2 was in development – here’s why. Spider-Man is one of the most popular superheroes from the pages of Marvel Comics, and while it had already been adapted to TV (both animated and live-action), his big-screen debut came in 2002 with Sam Raimi’s Spider-Man, which introduced Tobey Maguire as the title hero.

Spider-Man was a success with critics and viewers, who praised the tone, fidelity to the comic books, action sequences, and the performances of the main cast, particularly those of Maguire, Willem Dafoe (Norman Osborn/Green Goblin), and J.K. Simmons (J. Jonah Jameson). Spider-Man is credited for redefining the superhero genre and the summer blockbuster and made way for two more sequels, appropriately titled Spider-Man 2 and Spider-Man 3. Maguire and the rest of the main cast returned for all sequels, but Peter Parker almost went through a recast for Spider-Man 2.

Related: Why Sam Raimi's Spider-Man Movies Changed The Comics' Classic Webshooters

When Tobey Maguire signed on to play Spider-Man, he was given a three-film contract, but in-between films he got involved in other projects. Prior to Spider-Man 2, he produced Spike Lee’s drama 25th Hour and starred in Gary Ross’ Seabiscuit, where he played horse jockey John “Red” Pollard. While filming Seabiscuit, Maguire suffered injuries to his back, and given the physicality that a role like Spider-Man requires, Sony faced the possibility of recasting their lead after just one movie. The studio was very close to finding a replacement, and the actor who was first in line to play Peter Parker was Jake Gyllenhaal.

Mysterio with his helmet off in Spider-Man Far From Home

At the time, Jake Gyllenhaal was already a well-known name thanks to his roles in October Sky and Donnie Darko, but starring in Spider-Man 2 would have given his career a major boost. Gyllenhaal reportedly had begun preparing to take on the role of Peter Parker when Maguire recovered and decided he was ready to reprise his role. Gyllenhaal’s name became popular after starring in Roland Emmerich’s apocalyptic action film The Day After Tomorrow and went on to appear in a number of films, most notably Brokeback Mountain, Jarhead, Zodiac, Nocturnal Animals, and the infamous Prince of Persia: The Sands of Time. In an interesting turn of events, Gyllenhaal ended up joining Spider-Man’s universe thanks to his role as Quentin Beck/Mysterio in the Marvel Cinematic Universe’s Spider-Man: Far From Home.

Perhaps it wasn’t the right time for Jake Gyllenhaal to join the Marvel universe, but it all worked out quite well for him and Tobey Maguire. The latter’s version of Spider-Man is still a favorite among fans, who still hope he will reprise the role at some point (in case the MCU’s multiverse wants to go in that direction), and Jake Gyllenhaal’s time in the MCU might have been brief, but he changed this connected universe forever.

Next: Why Marvel Movies Still Haven't Topped Sam Raimi's Spider-Man 2