The Chao have disappeared and Sonic the Hedgehog and Miles "Tails" Prower immediately get on the case to find them. It turns out that Eggman Nega (once again masquerading as Doctor Eggman) has stolen the Chao and concealed them inside a haunted mansion. His plan is to feed them to an inter-dimensional beast called the "Ifrit" who needs to eat them to become invincible . After that, he plans to release the Ifrit into the world in order to destroy it. However, to open the portal to the Ifrit's world, the seven Chaos Emeralds are required. Eggman Nega secretly hires Rouge the Bat to collect the Chaos Emeralds. The Master Emerald has also gone missing (again) and Knuckles the Echidna teams up with Rouge to find it.
Meanwhile, Silver the Hedgehog has returned from a now ruined future caused by the Ifrit. In order to make a happier future, he searches for and steals the Chao that are left in order to hide them. Espio first thought that Silver was hiding Chao for a cause of evil, but Espio finds out that Silver was trying to save the world. Then, they work together to save the world. The real Dr. Eggman sends Metal Sonic to find Shadow, and tells him of Nega's plans. Nega has learned of the Ifrit by accessing Professor Gerald Robotnik's journals, and Shadow and Metal Sonic set out to retrieve the Chaos Emeralds before he does. Eggman uses Metal Sonic as a communication device to aid Shadow along the way.
All of the teams meet up at the Mystic Haunt Zone where the portal to the Ifrit's world is. Despite Rouge only collecting six of the Emeralds, the portal opens anyway and Nega dispatches his newly copy of Metal Sonic, Metal Sonic 3.0 to awaken the Ifrit. Despite possessing the minds of Sonic, Tails, Knuckles, and Rouge (depending on who the player plays as), the Ifrit is defeated by the other teams. Shadow and Metal Sonic defeat the Ifrit and close the portal but they and Eggman Nega are trapped in the Ifrit's dimension. However, Metal Sonic tears his chassis open, revealing the 7th Chaos Emerald. Shadow uses the Emerald to teleport back with Metal Sonic. Nega is left trapped under some rubble.
Sonic and Tails save all the Chao and bring them to a Chao Garden and relax there while Knuckles finds the Master Emerald in the Emerald Detector that he and Rouge stole from Eggman Nega. Rouge steals the Master Emerald and runs, and Silver returns to what he hopes is a happy future. Espio has to answer to Vector the Crocodile who has spent their client's advanced payment on late rental fees.