Sora and company eventually make it into Hollow Bastion, the lair of Maleficent and her group of villains. Sora realizes there is something familiar about the castle, but Donald brushes it off.
As the trio make their way up towards a rock near the castle, they encounter the Beast, who has been pursuing Princess of Heart Belle. However, Riku arrives and incapacitates the Beast before dropping a big bombshell: he is meant to be the Keyblade's wielder, not Sora. Despite Sora's protests, Riku points out that Sora was merely the delivery boy and steals the Keyblade for his own; Donald and Goofy have no choice but to follow Riku since he has the Keyblade. Before leaving, Riku tosses Sora his old wooden sword.
But Sora isn't done yet, and teams up with the Beast to chase Riku. With the Beast's help in defeating the Heartless, Sora manages to break into Hollow Bastion's basement and opens up the chapel doors. However, the Beast is distracted by a Heartless copy of Belle. Riku arrives and prepares to kill Sora, but Goofy blocks the attack; despite the Kings orders, Sora is still a dear friend. Donald follows suit and rejoins Soras side, prompting Sora to realize that he doesnt need the Keyblade; he has his heart.
With those words, Sora regains the Keyblade and proceeds to defeat Riku, who then retreats. As Riku mopes about his defeat, he encounters the robed figure, who offers more power and promptly possesses him. As Maleficent assembles the Princesses of Heart to reveal the Final Keyhole, "Riku" approaches, now wielding a dark Keyblade...
With the Beast on their side, Sora and company fight their way up Hollow Bastion. They make it into the castle chapel, where Maleficent meets them. She engages the heroes in an epic battle, but they defeat her, forcing her to retreat with them in pursuit. But "Riku" arrives and reveals that his Keyblade can unlock people's hearts and demonstrates it by stabbing Maleficent, transforming her into a dragon, but they overpower her, too.
As the Beast leaves, Sora and company chase "Riku" into the sanctum of the castle, where Sora finally reunites with an unconscious Kairi. "Riku" explains that she has lost her heart, but reveals that she's a Princess of Heart and where her heart's been all this time: inside Sora. He introduces himself as "Ansem, the Seeker of Darkness."
That's right- Ansem, the scientist researching the Heartless, is leading them.
Ansem prepares to rip Kairi's heart from Sora to complete the Keyhole, but Sora retaliates and duels Ansem in a lengthy battle. Though Sora sends Ansem packing, the Keyhole is about to explode, so Sora stabs himself with Ansem's Keyblade, freeing all seven princesses, even Kairi, but at the cost of his own heart. Ansem, having modeled Riku's body differently, declares that Kairi is now useless, but Donald and Goofy save her and the three flee from Ansem's Heartless.
Sora, now a Heartless, takes pursuit and catches up with them at the bottom of the castle. Donald mistakes Sora for the enemy, but Kairi sees through, and restores him to normal. Together, with Kairi saved, Sora and company leave for Traverse Town again...