Two years after Norman Osborn’s death, Peter Parker, secretly the superhero Spider-Man, is estranged from both his love interest Mary Jane Watson and his best friend Harry Osborn; he also discovers that his aunt May is facing eviction. He finds himself suffering temporary, but recurring losses of his powers, often in life-threatening situations.
Harry, who is now head of Oscorp’s genetic and scientific research division, is sponsoring a fusion power project by nuclear scientist Otto Octavius, who befriends and mentors Peter. While handling hazardous materials, Octavius wears a harness of powerful robotic tentacle arms with artificial intelligence. During a public demonstration that Peter and Harry attend, a power spike causes the fusion reactor to destabilize. Octavius refuses to shut down the reactor, which goes critical – killing his wife and burning the inhibitor chip blocking the arms from his nervous system. Peter, as Spider-Man, shuts the experiment down, destroying it in the process.
At a hospital, doctors prepare to surgically remove Octavius’ harness. Without the inhibitor chip, the now sentient arms defend themselves by killing the doctors. Upon regaining consciousness and seeing the carnage, Octavius escapes and takes refuge at a harbor. Becoming increasingly influenced by the arms’ AI, he decides to re-try his experiment. He robs a bank to fund a second experiment. Peter and May coincidentally are there, and Octavius takes May hostage. Peter rescues her, but Octavius flees with the stolen money. The Daily Bugle subsequently dubs the scientist Doctor Octopus.
Mary Jane becomes engaged to astronaut John Jameson, the son of Bugle editor J. Jonah Jameson. Peter suffers an emotional breakdown over his inability to balance his life and loses his powers. He abandons his Spider-Man identity, returns to his normal life, and attempts to reconcile with Mary Jane, but with little success. A garbageman brings Peter’s Spider-Man costume to Jameson, who takes credit for driving Spider-Man into hiding. Peter tells May the truth behind his uncle Ben’s death and how he is responsible. May forgives him, but the rise in New York City crime rates worries Peter.
Requiring the isotope tritium to fuel his reactor, Octavius visits Harry to demand it. Harry agrees in exchange for Spider-Man, whom he believes is responsible for Norman’s death. He tells Octavius to seek Peter, who Harry believes is friends with Spider-Man, but tells Octavius not to harm him. Octavius locates Peter, tells him to find Spider-Man, and captures Mary Jane. Her endangerment leads to Peter’s powers resurrecting. As Jameson admits that he was wrong about Spider-Man, Peter steals his costume back from the Bugle and goes after Octavius.
As Peter battles Octavius, they fall onto a New York City Subway train. Octavius sabotages the controls and leaves Peter to save the passengers, which he does at a great physical toll. When he faints from exhaustion, the grateful passengers save him from falling and bring him into the train, seeing his unmasked face but promising to keep their knowledge hidden. They unsuccessfully try to protect him when Octavius returns to capture Peter, whom Octavius delivers to Harry.
After giving Octavius the tritium, Harry prepares to kill Spider-Man, only to be shocked to see Peter under the mask. Peter convinces Harry to direct him to Octavius’ lair, as bigger things are at stake. As Peter arrives at the doctor’s waterfront laboratory and attempts to rescue Mary Jane discreetly, Octavius discovers him, and they battle as the nuclear reaction swells. Peter ultimately subdues Octavius, reveals his identity, and persuades Octavius to let his dream go for the greater good. Octavius commands the tentacles to obey him, and gives his life to destroy the experiment. Mary Jane sees Peter’s true identity and feelings, which he says is why they cannot be together. Peter returns Mary Jane to John, and leaves.
Harry is visited by a vision of his father in a mirror, pleading for Harry to avenge his death. Harry shatters the mirror, inadvertently revealing a secret room containing prototypes of the Green Goblin’s equipment. On her wedding day, Mary Jane abandons John at the altar and runs to Peter’s apartment. After they kiss, they hear police sirens, and Mary Jane encourages him to go help as Spider-Man.