In Islamic folklore, the afarit became a class of
chthonic spirits, inhabiting the layers of the
seven earths, generally ruthless and wicked, formed out of smoke and fire. Despite their negative depictions and affiliation to the nether regions, afarit are not fundamentally evil on a moral plane; they might even carry out God's purpose. Such obligations can nevertheless be ruthless, such as obligation to blood vengeance and avenging murder. Further, an ifrit can be compelled by a
sorcerer, if summoned. early 4th–1st century BC (
Walters Art Museum, Baltimore)|200x200px Although afarit are not necessarily components of a person, but independent entities, a common belief in
Islamic Egypt associates afarit with part of a human's soul. Probably influenced by the
Ancient Egypt idea of
Ka, the afarit are often identified with the spirits of the dead, departing from the body at the moment of death. They live in cemeteries, wander around places the dead person frequently visited, or roam the earth close to the place of death, until
the Day of Judgment. A person who died a natural death does not have a malevolent ifrit. Only people who are killed give rise to a dangerous and active ifrit, drawn to the blood of the victim. Driving an unused nail into the blood is supposed to stop their formation. Such afarit might scare and even kill the living or take revenge on the murderer. than other demons. However, their shapeshifting abilities are inferior compared to jinn.
Mahan and the Ifrit to
Nizami Ganjavi's poem
Hamsa.
Bukhara, 1648.
Nizami Ganjavi (c. 1141–1209) narrates in his
Haft Peykar the story of the Egyptian wayfarer Māhān (the "moonlike one") and his travels to a demon-infested desert. Māhān's horse, presented to him by a demon in human disguise, gallops his rider into the desert, where it turns into a seven-headed monster. In the desert, Māhān finds shelter in a mysterious
oasis owned by an old man. After Māhān and the old man know each other better, the old man decides to bequeath his legacy and marry him to a beautiful woman. He leaves to prepare for the wedding and warns Māhān that he must not descend from the perch until the old man is back. After that, the house, garden, and wife will belong to him. When a beautiful girl with the face of a
parī (fairy) enters the room, Māhān is overwhelmed by his lust and passion and ignores the order of the old man. While the beauty of his desire embraces Māhān, the girl suddenly turns into an ifrit, formed from God's wrath. The demon explains that the fairy turned into a demon because of Māhān's uncontrollable passion. Thereupon, the ifrit explains that he now must tear Māhān apart; if it were to spare him, the monster would be no true demon (
dēw). Furthermore, the ifrit, as a demon, is ashamed to have presented as a fairy in the first place. Māhān is saved when the rooster sounds in the morning and everything demonic vanishes. Nizami notes that the meaning of the story is that the ifrit is the consequence of Māhān's moral transgression. The ifrits in the story feature as moral instance and guardians of moral order. ==In fiction==