Erazor Djinn is a genie who serves as the primary antagonist in Sonic and the Secret Rings. His name is a pun on the words "Eraser" and "Razor" because he is "erasing" the pages of the book and he uses a "razor"-like weapon. He is voiced by Masashi Ebara in Japanese and Peter Cormican in English. A running gag throughout the game is that Erazor constantly refers to Sonic the Hedgehog as a rat, and Sonic tells him that he is a hedgehog, which leads Erazor to say that "all vermin are alike to [him]." The only time throughout the game that he correctly identifies Sonic as a hedgehog is when he is about to kill Sonic in order to obtain complete control over the World Rings.
Erazor is the Genie of the Lamp from the tale of Aladdin and the Magic Lamp. In his story, he was punished for misdeeds, and was to remain in his lamp until he had granted the wishes of one thousand people. When he had fulfilled his sentence and was finally freed, he had a renewed hatred of the creator of the stories, and began to take over the Arabian Nights, twisting the words that supported the stories into spirits that followed his command. He attempts to absorb the pages of the book, so he can control the entire world of Arabian Nights, as well as make his way into Sonic's world. He curses Sonic by embedding a flaming arrow in his chest. The curse made it that when the flame completely burns out, Sonic would die. Erazor makes a deal with Sonic: bring the Seven World Rings to him and he would remove the arrow, but because of the curse, he only had a limited time to find the Rings. Unbeknowst to Sonic, Erazor did not intend to help, instead he planned to use Sonic as a sacrifice to fulfill the prophecy of opening the gateway between worlds and gaining ultimate power.
After the rings are collected, Erazor needs to sacrifice Sonic to utilize their full power. As he made his strike, Shahra gets in the way to save Sonic. She slowly dies, begging for Sonic's forgiveness. With the power of the World Rings, Erazor transforms into Alf Layla wa-Layla (which translates to 1,000 and 1 Nights in Arabic), though he is incomplete because Sonic is still alive. Four of the World Rings get fused into Sonic, transforming him into Darkspine Sonic. Alf Layla wa-Layla then battles Darkspine Sonic trying to sacrifice him as the distant voice of Shahra guides Sonic. After the battle, Erazor reverts back to his normal form, as well as Sonic. Erazor boasts about being immortal, and that he'll always come back after defeat. However, Sonic uses the magic lamp given to him by Shahra, which was inactive at the time, and uses three wishes: to bring Shahra back to life, to restore the stories of the Arabian Nights, and to seal Erazor Djinn away in the lamp for the rest of time. Helpless against the mystic powers of the lamp, the defeated genie was forced to grant them all, and doomed himself to his eternal prison. During the game credits, Sonic is seen tossing Erazor's lamp into the lava of the Ifrit Golem's chamber, either to destroy the lamp or to ensure that nobody will ever find it and free Erazor again.