In 1974, a meteorite containing Shadow the Hedgehog crashes in Oklahoma, where GUN experiments on him. He forms a bond with Maria, Gerald Robotnik’s granddaughter, but she is accidentally killed during an escape attempt, and Shadow is placed in suspended animation. Fifty years later, Shadow is released, causing chaos in Tokyo. Sonic, Tails, and Knuckles are recruited by GUN to stop him but later decide to track Shadow themselves after learning about his past.
They discover Doctor Robotnik’s drones were not sent by him, and team up with him to find Shadow. Shadow captures the group, and Robotnik’s grandfather, Gerald, reveals his plan to destroy GUN's headquarters using the Eclipse Cannon, an orbital weapon powered by two keycards. Shadow obtains one keycard, and Sonic, Tails, and Knuckles try to steal the second from GUN's headquarters. After Shadow gravely injures Tom, Sonic transforms into Super Sonic and confronts Shadow, who also becomes Super Shadow. Sonic defeats him and convinces Shadow to let go of revenge.
Gerald plans to use the Eclipse Cannon to destroy Earth as revenge for Maria’s death. After a fight with Robotnik, Gerald is killed, and Sonic, Tails, Knuckles, and Shadow redirect the cannon. Shadow and Robotnik sacrifice themselves to prevent the cannon from destroying Earth, though Shadow survives. Sonic reconciles with his friends, and during a race, is saved by Amy Rose after being attacked by Metal Sonic robots.