The game follows Sonic, Shadow, and Silver in a story intertwined in their respective gameplay modes.
In Soleanna (inspired by Venice, the famous Italian city) the Festival of the Sun's opening ceremony is disrupted by the arrival of Doctor Eggman who seeks the Flames of Disaster from Princess Elise, and the Chaos Emerald she possesses. However, Sonic the Hedgehog arrives and escapes with Elise and the emerald intact, but Elise is quickly captured and she tosses the emerald to Sonic. Sonic meets with Miles "Tails" Prower and they rescue Elise, Tails distracting Eggman's robots while Sonic and Elise escape. Meanwhile, Shadow saves Rouge the Bat, who had the Scepter of Darkness stolen from Eggman's base, but it is dropped, unleashing Mephiles the Dark, a creature in Shadow's image who reveals Shadow sealed him within the scepter ten years ago, before opening a wormhole which transports Shadow and Rouge to the future. Silver and his friend Blaze the Cat live in a post-apocalyptic world caused by the Flames of Disaster and a fiery monster named Iblis. The two meet Mephiles who reveals Sonic as the Iblis Trigger, and sends the two back in time using the purple Chaos Emerald. Silver and Blaze are separated upon arrival, with Silver witnessing Eggman's attack on Soleanna and Sonic's departure. He meets Amy Rose who accompanies him to find but defends Sonic when they find him, while Eggman recaptures Elise. Sonic flees, meeting with Tails andKnuckles the Echidna who go to rescue Elise. However, Eggman lures them into a trap and warps them into the future where Tails discovers Elise and Eggman died the day before Iblis was released. Shadow and Rouge find a shutdown E-123 Omega, and then reunite with Sonic, Tails and Knuckles. They gather two of the Chaos Emeralds, and return to the present. Shadow faces Mephiles, but learns in the future he was imprisoned by Omega, blamed for the destruction. Shadow and Omega escapes to the present-day.
Shadow and Silver travels ten years into the past and learn Iblis and Mephiles are the result of the Duke of Soleanna's project to harness the power of the city's god Solaris. The Duke gives Shadow the Scepter of Darkness, which he uses to seal Mephiles, while Silver and the Duke seals Iblis into a young Elise's tears, the dying Duke asks his daughter not to cry for her tears could release Iblis. Sonic fails to reach Eggman's ship with Elise inside it before it explodes, but Silver sends Sonic back in time so he can save Elise. With Shadow, Rouge and Omega defeats Mephiles' clones, Silver and Blaze stop Iblis in the future, at the cost of Blaze's life.
Surviving Shadow's attack, Mephiles holds up the purple Chaos Emerald in use and kills Sonic with an energy blade behind him, causing Elise to cry and unleash Iblis. Mephiles bonds with Iblis, recreating Solaris and ripping apart the time-space continuum. As everyone mourns Sonic's apparent death, Silver theorises that seven Chaos Emeralds' power would revive Sonic, prompting everyone to locate it all. As they are all gathered Elise kisses Sonic, transforming him into Super Sonic who transfers some his power to Shadow and Silver, and together they defeat Solaris. Sonic and Elise go back in time, finding Solaris' original form as a single white flame. Elise blows out the candle to erase Solaris from existence and the story's events so that Solaris can befriend Elise again, rebooting the time-space continuum. Back in the very beginning, Sonic passes by Elise the Festival of the Sun to show signs of recalling their friendship.