Spider-Man 2 is a 2004 American superhero film directed by Sam Raimi and written by Alvin Sargent from a story by Alfred Gough, Miles Millar and Michael Chabon. Based on the fictional Marvel Comics character of the same name, it is the second installment in the Spider-Man trilogy and the sequel to Spider-Man (2002), starring Tobey Maguire alongside Kirsten Dunst, James Franco, Alfred Molina, Rosemary Harris, and Donna Murphy.
Set two years after the events of Spider-Man, the film finds Peter Parker struggling to manage both his personal life and his duties as Spider-Man, which affects his civilian life dramatically. Meanwhile scientist and Peter's mentor Dr. Otto Octavius becomes a diabolical villain after a failed experiment kills his wife and leaves him neurologically fused to mechanical tentacles. Spider-Man must stop him from recreating the dangerous experiment, while dealing with a subconscious desire to stop being Spider-Man that is stripping him of his powers. Raimi's inspiration for the film came from the comic book debut of Doctor Octopus in 1964, the 1966 story arc If This Be My Destiny...!, and the 1967 story arc Spider-Man No More!