Before Islam, Arabs already believed in angels and demons. Evil spirits (djinn) could be trapped in a bottle by occult magicians or sorcerors who would then use their power to acquire things. This is the origin of the Genie in the Lamp. Magicians also sat on carpets to meditate, and claimed to reach great heights of consciousness. This is where the Magic Flying Carpet comes from. Since the coming of Islam, Arab mythology has taken aboard Muslim religion and, according to one legend, when the 12th Imam comes to power, he will finally defeat Shaitan (Satan) in the last battle.