After burying Dobby, Harry Potter asks the goblin Griphook to help him, Ron, and Hermione break into Bellatrix Lestrange’s vault at Gringotts bank, suspecting a Horcrux may be there. Griphook agrees, in exchange for the Sword of Gryffindor. Wandmaker Ollivander tells Harry that two wands taken from Malfoy Manor belonged to Bellatrix and to Draco Malfoy, but Malfoy’s has changed its allegiance to Harry.
In Bellatrix’s vault, Harry discovers the Horcrux is Helga Hufflepuff’s cup. He retrieves it, but Griphook snatches the sword and abandons the trio, leaving them cornered by security. The three release the dragon guardian and flee on its back. Harry sees a vision of Voldemort killing goblins, including Griphook, and learns Voldemort is aware of the theft. Harry also realises there is a Horcrux at Hogwarts somehow connected to Rowena Ravenclaw. The trio apparate into Hogsmeade, where Aberforth Dumbledore reluctantly instructs the portrait of his deceased younger sister, Ariana, to fetch Neville Longbottom, who leads the trio through a secret passageway into Hogwarts.
Severus Snape hears of Harry’s return and warns staff and students of punishment for aiding Harry. Harry confronts Snape, who flees after Minerva McGonagall challenges him to a duel. McGonagall gathers the Hogwarts community for battle. At Luna Lovegood’s insistence and Cho Chang’s knowledge, Harry speaks to Helena Ravenclaw’s ghost, who reveals that Voldemort performed “dark magic” on her mother’s diadem, which is in the Room of Requirement. In the Chamber of Secrets, Ron and Hermione destroy the Horcrux cup with a Basilisk fang. Afterwards, the two share a kiss. In the Room of Requirement, Draco, Blaise Zabini and Gregory Goyle attack Harry after he finds the diadem, but Ron and Hermione intervene. Goyle casts a Fiendfyre curse and, unable to control it, is swallowed up by the flames while Harry and his friends save Malfoy and Zabini. Harry stabs the diadem with the Basilisk fang and Ron kicks it into the Room of Requirement, where it is destroyed. As Voldemort’s army attacks, Harry, seeing into Voldemort’s mind, realises that Voldemort’s snake Nagini is the final Horcrux. The trio race through the entry courtyard, where a fierce battle is raging, to the Hogwarts’ Boathouse, where they witness Voldemort incorrectly telling Snape that the Elder Wand cannot serve Voldemort until Snape dies since he killed its last owner (Dumbledore); he then orders Nagini to kill Snape, which Nagini does. Before dying, Snape tells Harry to take his memories to the Pensieve. In the chaos at Hogwarts, Fred, Lupin, and Tonks have been killed.