The story begins with Sonic confronting his nemesis, Dr. Eggman, on his flagship in outer space. Eggman then activated the ships defense systems, activating the cannons and bringing forth a horde of Egg Fighters. After seeing the obstacles, Sonic boosted forward and began dodging the batteries fired from the cannons. Bounding across the flagship, Eggman brought forth his Mech and unleashed a flurry of machine gun fire. After running across the ceiling while dodging missiles, Sonic ran through the Flagship's hallway. Eggman fired his Mech's grappling hook-like arm and grabbed Sonic. After being pulled to Eggman in the Mech's grasp, Sonic summoned the Chaos Emeralds from within himself and became Super Sonic in order to stop him, destroying Eggman's mech in the process. Eggman fled in his Egg Mobile and fled from his Flagship.
After chasing Eggman through space and destroying half of his fleet, they finally arrived at Eggman's Research Facility and knocking Eggman himself to the ground. Eggman pleads for mercy, but this turns out to be a trap. When Sonic is close enough, he activates the Chaos Energy Cannon, which traps Sonic in the center and begins drawing the Chaos energy out of Sonic and the Emeralds in a fashion that is clearly extremely painful for him. After the weapon is charged, Eggman fires a laser at the Earth to wake a monster known as Dark Gaia, splitting the planet into several continents. The dark energy of the Emeralds is brought out by the ray, transforming Sonic into a werewolf-like creature and rendering the Chaos Emeralds gray and powerless. Eggman then opens an airlock which sucks Sonic and the drained Emeralds out into space and down to Earth.
While Sonic is saved from a fatal landing due to an unknown energy source, he still ends up taking a heavy fall. After pulling himself out of the dirt, Sonic encounters a flying dog-like creature. Sonic then asks the creature what his name was and the creature couldn't remember his own name or history (which Sonic thinks he landed on him, causing the memory loss). Sonic agrees to help Chip restore his memory during their journey. As the sun rises, Sonic is transformed into his original form.
After exploring the city of Apotos, Sonic names the creature Chip and the two run into Tails at night. Tails immediately recognizes Sonic even though he is in his Werehog form and reveals that Professor Pickle of Spagonia University may be able to help them on their adventure. Once they reach Spagonia, they discover Dr. Eggman has kidnapped Professor Pickle for his knowledge on Dark Gaia. After traveling to Mazuri and freeing him, Professor Pickle explains the nature of Dark Gaia and reveals that restoring power to the Chaos Emeralds via the Gaia Temples would help the planet return to normal. Sonic then sets out to the seven Gaia Temples to restore the Chaos Emeralds and reassemble the planet.
Later that night, Sonic and Chip run into Amy, who doesn't recognize Sonic in his Werehog form. He later saves Amy from Dark Gaia's influence and she learns that it was Sonic in his werehog form and decides to help him and Professor Pickle. All the while, Dr. Eggman makes plans to reassemble Dark Gaia and finish Eggmanland.
During the restoration of the sixth Chaos Emerald and continent, it's revealed that Chip is in fact Light Gaia, the opposite of Dark Gaia, and he lost his memories because, like Dark Gaia, he was prematurely awakened by Eggman's laser when Eggman started the Time of Awakening, where Chip and Dark Gaia was meant to awaken, too early; likewise, Dark Gaia has not yet been fully reborn due to his premature awakening, and Sonic must stop Eggman before Dark Gaia's full powers return to its normal state.
At this point, Sonic travels to the location of the last temple, over which Eggman has built Eggmanland using an extraction of Dark Gaia's power. While Sonic is able to restore the last emerald and defeat Eggman's Egg Dragoon, Dark Gaia becomes complete, by draining the dark energy that Sonic had that turned him into Werehog, knocking Dr. Eggman out of the way to keep the power for itself. Sonic is too weak to move so Chip uses the Gaia Temples to form a body called Gaia Colossus to battle the massive creature.
Sonic recovers on the Gaia Colossus and helps Chip fight Dark Gaia. Chip and Sonic hold off the beast, but Dark Gaia manages to drown the planet in darkness, achieving its fully-matured form in the process. Sonic then transforms into Super Sonic using the seven Chaos Emeralds and takes Perfect Dark Gaia down with the help of Gaia Colossus, but the battle leaves him too drained of his energy to escape. As the final continent moves back into place, Chip flings Sonic back onto the surface while he remains behind.
After Sonic wakes up, Chip's necklace and some parting words are found on the ground. Sonic then picks it up and puts on the necklace as a bracelet to remind them of their adventures together. The game ends as Sonic runs off with Tails, who is in the Tornado, to another adventure.