Magic existed before Sulayman (Solomon)
As-Suddi said that Allah's statement,
[وَاتَّبَعُواْ مَا تَتْلُواْ الشَّيَـطِينُ عَلَى مُلْكِ سُلَيْمَـنَ]
(They followed what the Shayatin (devils) gave out (falsely of the magic) in the lifetime of Sulayman) means, "`During the time of Prophet Solomon.' Beforehand, the devils used to ascend to heaven and eavesdrop on the conversations of the angels about what will occur on the earth regarding death, other incidents or unseen matters. They would convey this news to the soothsayers, and the soothsayers would in turn convey the news to the people. The people would believe what the soothsayers told them as being true. When the soothsayers trusted the devils, the devils started to lie to them and added other words to the true news that they heard, to the extent of adding seventy false words to each true word. The people recorded these words in some books. Soon after, the Children of Israel said that the Jinns know matters of the Unseen. When Solomon was sent as a Prophet, he collected these books in a box and buried it under his throne; any devil that dared get near the box was burned. Solomon said, `I will not hear of anyone who says that the devils know the Unseen, but I will cut off his head.' When Solomon died and the scholars who knew the truth about Solomon perished, there came another generation. To them, the devil materialized in the shape of a human and said to some of the Children of Israel, `Should I lead you to a treasure that you will never be able to use up' They said. `Yes.' He said, `Dig under this throne,' and he went with them and showed them Solomon's throne. They said to him, `Come closer.' He said, `No. I will wait for you here, and if you do not find the treasure then kill me. ' They dug and found the buried books, and Satan said to them, `Solomon only controlled the humans, devils and birds with this magic.' Thereafter, the news that Solomon was a sorcerer spread among the people, and the Children of Israel adopted these books. When Muhammad came, they disputed with him relying on these books. Hence Allah's statement,
[وَمَا كَفَرَ سُلَيْمَـنُ وَلَـكِنَّ الشَّيْاطِينَ كَفَرُواْ]
(Sulayman did not disbelieve, but the Shayatin (devils) disbelieved).