The following is taken from Ahkaam minal-Qur’aan Al-Kareem (Rulings from the Noble Qur’aan) by The Shaykh the al-‘Allaamah Muhammad ibn Saalih al-‘Uthaymeen (may Allaah’s forgiveness and mercy be upon him, his parents, and the Muslims):
1. Allaah (Subhanahu wa Ta’ala) subjected the Shayaateen to Sulaymaan, and then tested the people by way of them. This is derived from Allaah’s Words which say:
وَاتَّبَعُواْ مَا تَتْلُواْ الشَّيَاطِينُ عَلَى مُلْكِ سُلَيْمَانَ
“They followed what the Shayaateen (devils) gave out (falsely of magic) in the lifetime of Sulaymaan.”
2. Sulaymaan (alayhis-salaam) did not disbelieve; rather, these Shayaateen taught people sorcery, and continued to extend it to the people. Prophets are sinless with regard to committing acts of disbelief and polytheism.
3. Performing acts of sorcery is disbelief. This is derived from the saying of Allaah:
وَلَـكِنَّ الشَّيْاطِينَ كَفَرُواْ
“Rather it was the devils who disbelieved…”
4. Teaching people sorcery is an act of disbelief, because Allaah says:
وَلَـكِنَّ الشَّيْاطِينَ كَفَرُواْ يُعَلِّمُونَ النَّاسَ السِّحْرَ
“Rather it was the devils who disbelieved by teaching people sorcery…”
Sorcery is of two categories: The first category is the sorcery of the Shayaateen from the Jinn. This type comprises seeking their help, seeking protection from them and refuge from them. This is disbelief without a doubt. The second category is the sorcery that uses potions made from leaves, trees, and the like. These have no connection to the Shayaateen and therefore do not reach the level of kufr. However, this category is to considered forbidden because it entails causing harm and injury to others. If it is firmly proven by a Muslim government that an individual is practicing the first category of sorcery, he is to be executed for disbelief and apostasy. If it is the second category of sorcery, the person should be executed as a precautionary measure against his evil, and to prevent him from harming Muslims.
5. The truth is what Allaah permits to happen and in what He commands. This is the case even when the thing which has been permitted or commanded is itself invalid. In light of this, the two angels mentioned in the verse came down to earth to teach the people sorcery, and as has been previously discussed, the teaching of sorcery is disbelief. However, Allaah permitted these two angels to teach the people sorcery in order to test them by way of what the two angels were teaching. It is possible for something that is disbelief, under certain circumstances, to be obedience even if it is a category of disbelief. To clarify this, I offer the following two examples: 1) making prostration to other than Allaah is shirk; however, if Allaah commands that a prostration be made to other than Himself, then it is an act of worship. Have you not seen that Allaah says:
وَإِذْ قُلْنَا لِلْمَلاَئِكَةِ اسْجُدُواْ لآدَمَ فَسَجَدُواْ إِلاَّ إِبْلِيسَ
“And (remember) when We said to the angels ‘Prostrate yourselves before Adam!’ And they prostrated except Iblees (Shaytaan)…”
Sooratul-Baqarah 2:34
In this case we see that prostration to other than Allaah was obedience and an act of worship because Allaah commanded it. However, this same act is shirk if Allaah does not command it. 2) Taking a life is one of the major sins, especially if the victim is a close relative of the killer. This act could also be a praiseworthy act of obedience, as we see in the story of Ibraaheem with his son Ismaa’eel. Ibraheem saw in his dream that he had to slaughter his son Ismaa’eel. After he related his dream to his son, Ismaa’eel said:
يَا أَبَتِ افْعَلْ مَا تُؤْمَرُ سَتَجِدُنِي إِن شَاء اللَّهُ مِنَ الصَّابِرِينَ
“O! My father do what you have been commanded. You will find me, if Allaah wills, to be among the patient ones.”
Sooratus-Siffaat 37:102
Therefore, they submitted their affairs to Allaah, and they yielded themselves to Allaah’s Decree and Legislation. When Ibraaheem laid his son to slaughter him prostrate on his forehead, Allaah (Azza wa Jal) released him from this obligation.
وَنَـٰدَيۡنَـٰهُ أَن يَـٰٓإِبۡرَٲهِيمُ (١٠٤) قَدۡ صَدَّقۡتَ ٱلرُّءۡيَآۚ إِنَّا كَذَٲلِكَ نَجۡزِى ٱلۡمُحۡسِنِينَ
“We called out to him, O Abraham! You have fulfilled the dream! Verily, thus do we reward the doers of good.”
Sooratus-Siffaat 37:104-105
So in light of this concept, the two angels that were sent down to teach people sorcery were sent by the Command and the permission of Allaah. Therefore, the lessons in sorcery that they gave the people were in obedience to Allaah. However, it is still to be considered disbelief from the standpoint of those who were the recipients of this knowledge. That is why Allaah said:
وَمَا يُعَلِّمَانِ مِنْ أَحَدٍ حَتَّى يَقُولاَ إِنَّمَا نَحْنُ فِتْنَةٌ فَلاَ تَكْفُرْ
“But neither of these two (angels) taught (such things) till they said, We are only for trial, so disbelieve not (by learning this magic from us).”
Sooratul-Baqarah 2:102
6. There are times when Allaah (Azza wa Jal) makes the circumstances under which people can choose to commit sin easy. This is to test whether the people will sin against Allaah or not. So Allaah made the circumstances under which people could learn sorcery from the two angels easy. The angels freely gave these lessons to the people.
7. Whenever someone seeks to enter into a situation, it is obligatory to clearly reveal the circumstances of that situation devoid of any fraud or deception. This is the way to achieve complete sincerity and clarity. Therefore the two angels did not instruct anyone in sorcery until they both said:
إِنَّمَا نَحْنُ فِتْنَةٌ فَلاَ تَكْفُرْ
“…We are only for trial so disbelieve not…”
Sooratul-Baqarah 2:102
They clarified their own condition, and they clarified the condition of anyone who learned from them. The angels clarified that they came as a Fitnah (trial), and they both clarified that learning sorcery from them was disbelief.
8. One of the most powerful forms of sorcery is the one whose spell leads to the separation of spouses. This is based upon Allaah’s Saying:
فَيَتَعَلَّمُونَ مِنْهُمَا مَا يُفَرِّقُونَ بِهِ بَيْنَ الْمَرْءِ وَزَوْجِهِ
“And from these people they learned that by which they cause separation between man and his wife.”
This type of sorcery is called by two names (Al-‘Atf) (As-Sarf). This category of spell (al-‘Atf), if it is cast upon a person, he will develop an obsessive attachment to another person. He will not be able to control his own actions whenever he is around this person. The only thing he is able to do is follow this person around the way a sheep follows a shepherd when he calls it. The spell that has the opposite effect (as-Sarf) is a type of spell that makes a person separate from someone that is dear to him. This is the example of what happens between a man and his wife. He begins to view her as if she was one of his worst enemies, or the wife begins to view her husband in this light. This is one of the most potent forms of sorcery in terms of its ability to cause injury and harm.
9. Sorcery is not table to have any effect upon people except by the permission and Command of Allaah because Allaah (Azza wa Jal) says:
وَمَا هُم بِضَآرِّينَ بِهِ مِنْ أَحَدٍ إِلاَّ بِإِذْنِ اللّهِ
“But they could not thus harm anyone except by Allaah’s Leave…”
Sooratul-Baqarah 2:102
10. Whenever someone turns in refuge to his Lord and calls out to Him regarding a situation that befalls him, verily, Allaah is able to release him from that situation even if he has been afflicted by sorcery.
Allaah says in this regard:
وَمَا هُم بِضَآرِّينَ بِهِ مِنْ أَحَدٍ إِلاَّ بِإِذْنِ اللّهِ
“But they could not thus harm anyone except by Allaah’s Leave…”
Sooratul-Baqarah 2:102
11. There is an indication in this verse that a person who has been afflicted with sorcery must ask Allaah to release him from this affliction with conviction, sincerity, and a sense of urgency.
Allaah (Subhanahu wa Ta’ala) says:
أَمَّن يُجِيبُ الْمُضْطَرَّ إِذَا دَعَاهُ وَيَكْشِفُ السُّوءَ وَيَجْعَلُكُمْ خُلَفَاء الْأَرْضِ أَإِلَهٌ مَّعَ اللَّهِ قَلِيلًا مَّا تَذَكَّرُونَ
“Is not He (better than your gods) Who responds to the distressed one when he calls on Him, and removes the evil, and makes you inheritors of the earth, generations after generations. Is there any Ilaah (god) with Allaah? Little is it that you remember.”
Sooratun-Naml 27:62
It is possible that one of the strongest medicines, if not the strongest, to effect sorcery is for a person to take refuge with Allaah, while begging Him to release him from the affliction of sorcery. Therefore, when a powerful spell was cast on the Prophet (صلى الله عليه وسلم), Allaah sent down the two Sooraat of seeking refuge, Sooratul-Falaq and Sooratun-Naas. Then an angel read them over him, and Allaah healed him with that.
12. Sorcery is as harmful to the sorcerer, as it is to others, even if he believes it to be a benefit for him and that, he is earning a living. However, the earnings that he reaps are of a repulsive nature. The only increase he will receive from Allaah is distance from Him, and the only increase he will receive due to these earnings is loss.
This is why Allaah says:
وَيَتَعَلَّمُونَ مَا يَضُرُّهُمْ وَلاَ يَنفَعُهُمْ
“And they learned that which harms them and profits them not.”
Sooratul-Baqarah 2:102
13. A sorcerer is an unbeliever. This is derived from the saying of Allaah:
وَلَقَدْ عَلِمُواْ لَمَنِ اشْتَرَاهُ مَا لَهُ فِي الآخِرَةِ مِنْ خَلاَقٍ
“And indeed they knew that the buyer of it (magic) would have no share in the Hereafter.”
Sooratul-Baqarah 2:102
14. The repugnant nature of what these people achieved by learning is clear from Allaah’s saying:
وَلَبِئْسَ مَا شَرَوْاْ بِهِ أَنفُسَهُمْ
“And how bad indeed was that for which they sold their own selves…”
Sooratul-Baqarah 2:102
15. These people sold their own souls and thereby lost it so that they could learn the sorcery that Allaah has described in His saying:
وَلَبِئْسَ مَا شَرَوْاْ بِهِ أَنفُسَهُمْ
“And how bad indeed was that for which they sold their own selves…”
Sooratul-Baqarah 2:102
16. These people that chose to learn sorcery and thereby destroy themselves were the biggest ignoramuses, whether they understood that or not. In light of this Allaah says:
وَلَقَدْ عَلِمُواْ لَمَنِ اشْتَرَاهُ مَا لَهُ فِي الآخِرَةِ مِنْ خَلاَقٍ
“And indeed they knew that the buyer of it (magic) would have no share in the Hereafter.”
Sooratul-Baqarah 2:102
This shows that they know that the sorcerer does not have any share in the Hereafter. That they oppose and commit sin with clear knowledge, and refuge should be sought from Allaah.
Source: The Ruling of Sorcery, Fortune-Telling and Related Issues, The Eminent ash-Shaykh ‘Abdul-‘Azeez bin ‘Abdullaah bin Baaz, Translated by: Aboo Maryam Taalib ‘Abdullaah ibn Benjamin, Tarbiyyah Bookstore Publishing, pp. 18-22.