Short answer
Harut and Marut are two angels mentioned once in the Quran (2:102), sent down at Babylon as a trial for people. They taught about magic only after warning: "We are a trial, so do not disbelieve." The popular story that they fell in love with a woman and sinned is not authentic, and many scholars rejected it.
Muslims believe what the Quran says about Harut and Marut, and that angels do not disobey Allah. Learning and practising magic is haram, and magic that involves disbelief takes a person out of Islam, as 2:102 indicates.
The four schools agree on this.
Explanation
The verse answers a claim that Sulaiman (Solomon) ruled by magic: "It was not Solomon who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Harut and Marut. But the two angels do not teach anyone unless they say, We are a trial, so do not disbelieve" (2:102). The verse goes on to say that people learned from them what separates a man from his wife, but that they harm no one except by Allah's permission.
Why would angels teach about magic? Commentators gave two main answers. Some said Allah sent them to show people the difference between miracles and sorcery, at a time when magic was widespread, while warning them not to practise it. Others said it was a trial, as the angels themselves said: knowledge offered with a clear warning, to see who would obey. Either way, they did not sin; Allah describes the angels as those who "do not disobey Allah in what He commands them" (66:6).
The well-known story that the two angels were sent to earth, fell for a woman called Zuhrah, drank wine and committed murder, and that she became the planet Venus, appears in some books. Hadith critics judged the versions attributed to the Prophet ﷺ to be weak, and commentators such as Ibn Kathir said it most likely comes from Israelite sources. It conflicts with what the Quran says about angels, so it should not be repeated as fact.
The lesson of the verse is about magic: the Prophet ﷺ counted it among the seven destroying sins. Read is magic haram?, Angels in Islam and the story of Prophet Sulaiman.
The evidence
Quran, Surah Al-Baqara 2:102
وَٱتَّبَعُوا۟ مَا تَتْلُوا۟ ٱلشَّيَٰطِينُ عَلَىٰ مُلْكِ سُلَيْمَٰنَ ۖ وَمَا كَفَرَ سُلَيْمَٰنُ وَلَٰكِنَّ ٱلشَّيَٰطِينَ كَفَرُوا۟ يُعَلِّمُونَ ٱلنَّاسَ ٱلسِّحْرَ وَمَآ أُنزِلَ عَلَى ٱلْمَلَكَيْنِ بِبَابِلَ هَٰرُوتَ وَمَٰرُوتَ ۚ وَمَا يُعَلِّمَانِ مِنْ أَحَدٍ حَتَّىٰ يَقُولَآ إِنَّمَا نَحْنُ فِتْنَةٌۭ فَلَا تَكْفُرْ ۖ فَيَتَعَلَّمُونَ مِنْهُمَا مَا يُفَرِّقُونَ بِهِۦ بَيْنَ ٱلْمَرْءِ وَزَوْجِهِۦ ۚ وَمَا هُم بِضَآرِّينَ بِهِۦ مِنْ أَحَدٍ إِلَّا بِإِذْنِ ٱللَّهِ ۚ وَيَتَعَلَّمُونَ مَا يَضُرُّهُمْ وَلَا يَنفَعُهُمْ ۚ وَلَقَدْ عَلِمُوا۟ لَمَنِ ٱشْتَرَىٰهُ مَا لَهُۥ فِى ٱلْءَاخِرَةِ مِنْ خَلَٰقٍۢ ۚ وَلَبِئْسَ مَا شَرَوْا۟ بِهِۦٓ أَنفُسَهُمْ ۚ لَوْ كَانُوا۟ يَعْلَمُونَ ﴿١٠٢﴾
And they followed [instead] what the devils had recited during the reign of Solomon. It was not Solomon who disbelieved, but the devils disbelieved, teaching people magic and that which was revealed to the two angels at Babylon, Harut and Marut. But the two angels do not teach anyone unless they say, "We are a trial, so do not disbelieve [by practicing magic]." And [yet] they learn from them that by which they cause separation between a man and his wife. But they do not harm anyone through it except by permission of Allah. And the people learn what harms them and does not benefit them. But the Children of Israel certainly knew that whoever purchased the magic would not have in the Hereafter any share. And wretched is that for which they sold themselves, if they only knew.
The only verse naming Harut and Marut.
Quran, Surah At-Tahrim 66:6
يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ قُوٓا۟ أَنفُسَكُمْ وَأَهْلِيكُمْ نَارًۭا وَقُودُهَا ٱلنَّاسُ وَٱلْحِجَارَةُ عَلَيْهَا مَلَٰٓئِكَةٌ غِلَاظٌۭ شِدَادٌۭ لَّا يَعْصُونَ ٱللَّهَ مَآ أَمَرَهُمْ وَيَفْعَلُونَ مَا يُؤْمَرُونَ ﴿٦﴾
O you who have believed, protect yourselves and your families from a Fire whose fuel is people and stones, over which are [appointed] angels, harsh and severe; they do not disobey Allah in what He commands them but do what they are commanded.
Shows angels do not sin, against the story of their fall.
Sahih al-Bukhari 2766
Sahih... الشِّرْكُ بِاللَّهِ، وَالسِّحْرُ، وَقَتْلُ النَّفْسِ الَّتِي حَرَّمَ اللَّهُ إِلاَّ بِالْحَقِّ ...
"Associating partners with Allah, magic, and killing a soul Allah has made sacred, except by right."
Places magic among the seven destroying sins.
Where the ruling is recorded
- Tafsir Ibn Kathir, Commentary on Surah al-Baqarah, verse 102. Discusses the story of Harut and Marut and says the Zuhrah story is most likely from Israelite sources.
- Radd al-Muhtar (Ibn Abidin), Chapter on the apostate, on the sorcerer. Sets out the Hanafi ruling on learning and practising magic.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.