Spider-Man 3 is a 2007 American superhero film based on the fictional Marvel Comics character Spider-Man. It was directed by Sam Raimi from a screenplay by Raimi, his older brother Ivan and Alvin Sargent. It is the third and final installment in Raimi's Spider-Man trilogy. The film stars Tobey Maguire as Peter Parker / Spider-Man, alongside Kirsten Dunst, James Franco, Thomas Haden Church, Topher Grace, Bryce Dallas Howard, James Cromwell, Rosemary Harris and J. K. Simmons. Set shortly after the events of Spider-Man 2, as Peter Parker prepares his future with Mary Jane Watson, he bonds with an extraterrestrial symbiote, bringing out his anger while facing three villains: Uncle Ben's true killer, Flint Marko, who becomes the Sandman after a freak accident; Harry Osborn, who seeks to avenge his father; and Eddie Brock, a rival photographer who becomes Venom after acquiring Peter's symbiote.