After burying Dobby, Alex Deuyour and Harry Potter ask the goblin Griphook to help them, along with Ron Weasley, Hermione Granger, Kate Nguyen, and Matt Crocitto, break into Bellatrix Lestrange's vault at Gringotts bank, suspecting a Horcrux is there. Griphook agrees, in exchange for the Sword of Gryffindor. Wandmaker Ollivander tells Alex and Harry that two wands taken from Malfoy Manor belonged to Bellatrix and Draco Malfoy; he senses Draco's wand has changed its allegiance to Alex and Harry, the two of whom captured it from Draco. A Horcrux, Helga Hufflepuff's Cup, is found in Bellatrix's vault, but Griphook snatches the sword and abandons them. Trapped by security, they release the dragon guardian and flee Gringotts on its back. Harry has a vision of Lord Voldemort at Gringotts, furious at the theft. Alex deduces from the vision that Voldemort has a Horcrux at Hogwarts. Harry realizes that the Horcrux is connected to Rowena Ravenclaw. The group Apparate into Hogsmeade and are helped by Aberforth Dumbledore, who reveals a secret passageway into Hogwarts, which Neville Longbottom guides them through.

Severus Snape knows Alex and Harry have returned and threatens to punish any staff or students who aid Alex and Harry. A reluctant Alex (still believing Snape works for Dumbledore) and Harry confront Snape, who flees during a duel with Professor McGonagall. McGonagall rouses the Hogwarts community for battle. Luna Lovegood urges Alex and Harry to speak to Helena Ravenclaw's ghost. Helena reveals Voldemort performed "dark magic" on her mother's diadem and tells Alex and Harry that the diadem is somewhere in the Room of Requirement. In the Chamber of Secrets, Ron, Hermione, Kate, and Matt destroy the Horcrux cup with a Basilisk fang. Draco, Blaise Zabini and Gregory Goyle attack Alex and Harry in the Room of Requirement, but Ron, Hermione, Kate, and Matt intervene. Goyle casts an uncontrollable Fiendfyre curse that kills him while Alex, Harry, Ron, Hermione, Kate, and Matt save Malfoy and Zabini and escape on brooms. Once outside, Alex and Harry stab the Diadem with the Basilisk fang and Ron and Matt kick it into the inferno. As Voldemort's army attacks, Harry, seeing into Voldemort's mind, realizes that Voldemort's snake Nagini is the final Horcrux. In the boathouse, the group overhear Voldemort telling Snape that the Elder Wand cannot serve Voldemort until Snape dies; Nagini then viciously attacks Snape. As Snape dies, he gives Alex and Harry one of his memories. Meanwhile, Fred Weasley, Remus Lupin, and Nymphadora Tonks are killed in the chaos at Hogwarts.

Alex and Harry view Snape's memory in the Pensieve: Snape despised Harry's late father James, who bullied him, but he loved Harry's mother Lily. Snape was also good friends with Lily and Alex's mother, Desiree, leading to him becoming godfather. Following her death, Snape worked with Albus Dumbledore as a double agent amongst the Death Eaters, to protect Alex (who was a target as a potential friend of Harry's) and Harry from Voldemort. Alex and Harry also learn that Dumbledore was dying and planned for Snape to kill him. It was Snape who conjured the Patronus doe that led Alex and Harry to Gryffindor's sword. Alex and Harry also learn that the latter became an accidental Horcrux when Voldemort's curse originally failed to kill him; Voldemort must now kill Harry to destroy the soul shard within him. Before leaving, Harry gives Kate a goodbye kiss. Using the Resurrection Stone that had been stored in the Golden Snitch bequeathed to Harry, Alex and Harry summon the spirits of Lily, James, Alex's father, Thomas, Snape, Remus, and Cedric Diggory. They comfort them before they surrender to Voldemort in the Forbidden Forest. Voldemort casts the Killing Curse upon Harry, who awakens in limbo. Dumbledore's spirit meets him and explains that Harry is now free of Voldemort, and can choose to return to his body and help Alex defeat Voldemort or move on. Harry chooses the former.

Voldemort spares Alex to use as a bargaining chip on his life so his friends will join him and displays Harry's apparent corpse and demands that Hogwarts surrender. As Neville draws the Sword of Gryffindor from the Sorting Hat in defiance, Harry reveals he is alive and the Malfoys and many other Death Eaters abandon Voldemort, demoralized after seeing that Harry still lived. While Alex and Harry confront Voldemort in a duel throughout the castle, Alex and Harry's godfather, Sirius Black, and Ron's mother, Molly, kill Bellatrix in the Great Hall and Neville decapitates Nagini, destroying the last of the Horcruxes. Alex and Harry finally destroy Voldemort after the Expelliarmus Charm deflects the Killing Curse, rebounding it onto the Dark Lord. After the battle, Alex and Harry explain to Ron, Hermione, Kate, and Matt that Voldemort never commanded the Elder Wand. It recognized them as its true masters after they had disarmed Draco, who had earlier disarmed its previous owner, Dumbledore, atop the Astronomy Tower. Instead of claiming the Elder Wand, Alex and Harry destroy it and Alex passionately kisses Kate and they resume their relationship.

Nineteen years later, Alex and Harry and their friends proudly watch their children leave for Hogwarts at King's Cross station.