The Ifrit is a fiery demonic monster from another dimension, and the final boss of Sonic Rivals 2. His dimension is full of fire and ruins (presumed to be the result of destruction caused by the Ifrit). To become invincible, he must eat many Chao.
Eggman Nega searched for Chaos Emeralds to open the portal to Ifrit's dimension, and Chao to feed to him, intending to awaken and release him so he could destroy the world. However, Sonic, Tails, Knuckles, Rouge, Shadow, Metal Sonic, Silver, and Espio entered the Ifrit's dimension once Eggman Nega opened the portal.
Ifrit possessed Sonic, Tails, Knuckles, or Rouge (depending on who the character plays as, either Sonic or Tails can get possessed and the same goes for Rouge and Knuckles), but the other six were able to defeat the Ifrit, while simultaneously fighting off Metal Sonic 3.0 and the two possessed ones, and in defeat the Ifrit fell onto the ruins and was destroyed in an explosion of fire.
Everyone except Shadow, Metal Sonic, Eggman Nega, and presumably Metal Sonic 3.0 was able to escape through the portal before it closed (due to Shadow and Metal Sonic activating a switch), and Shadow used Chaos Control to escape with Metal Sonic (who had the green Chaos Emerald inside him), leaving Eggman Nega trapped under rubble, unable to escape the Ifrit's dimension.