 Based on the Quran, regarding Islamic legends of Solomon, magic was taught by devils to the humans.Solomon took the writings of the sorcerer away and hid them under his throne.After his death, Iblis, unable to get close to Solomons court, told the people, they will find a treasure under the throne and thus lead them to sorcery.