﴿ وَمَآ أُنزِلَ عَلَى ٱلۡمَلَڪَيۡنِ بِبَابِلَ هَـٰرُوتَ وَمَـٰرُوتَۚ وَمَا يُعَلِّمَانِ مِنۡ أَحَدٍ حَتَّىٰ يَقُولَآ إِنَّمَا نَحۡنُ فِتۡنَةٌ۬ فَلَا تَكۡفُرۡۖ فَيَتَعَلَّمُونَ مِنۡهُمَا مَا يُفَرِّقُونَ بِهِۦ بَيۡنَ ٱلۡمَرۡءِ وَزَوۡجِهِۦۚ ﴾
(And such things that came down at Babylon to the two angels, Harut and Marut, but neither of these two (angels) taught anyone (such things) till they had said, "We are for trial, so disbelieve not (by learning this magic from us).'' And from these (angels) people learn that by which they cause separation between man and his wife).
There is a difference of opinion regarding this story. It was said that this Ayah denies that anything was sent down to the two angels, as Al-Qurtubi stated and then referred to the Ayah,
﴿ وَمَا ڪَفَرَ سُلَيۡمَـٰنُ ﴾
(Sulayman did not disbelieve) saying, "The negation applies in both cases. Allah then said,
﴿ وَلَـٰكِنَّ ٱلشَّيَـٰطِينَ كَفَرُواْ يُعَلِّمُونَ ٱلنَّاسَ ٱلسِّحۡرَ وَمَآ أُنزِلَ عَلَى ٱلۡمَلَڪَيۡنِ ﴾
(But the Shayatin (devils) disbelieved, teaching men magic and such things that came down at Babylon to the two angels).
The Jews claimed that Gabriel and Michael brought magic down to the two angels, but Allah refuted this false claim.''
Also, Ibn Jarir reported, that Al-`Awfi said that Ibn `Abbas said about Allah's statement,
﴿ وَمَآ أُنزِلَ عَلَى ٱلۡمَلَڪَيۡنِ بِبَابِلَ ﴾
(And such things that came down at Babylon to the two angels)
"Allah did not send magic down.''
Also, Ibn Jarir narrated that Ar-Rabi` bin Anas said about,
﴿ وَمَآ أُنزِلَ عَلَى ٱلۡمَلَڪَيۡنِ ﴾
(And such things that came down to the two angels), "Allah did not send magic down to the them.'' Ibn Jarir commented, "This is the correct explanation for this Ayah.
﴿ وَٱتَّبَعُواْ مَا تَتۡلُواْ ٱلشَّيَـٰطِينُ عَلَىٰ مُلۡكِ سُلَيۡمَـٰنَۖ ﴾
(They followed what the Shayatin (devils) gave out (falsely) in the lifetime of Sulayman.) meaning, magic. However, neither did Solomon disbelieve nor did Allah send magic with the two angels. The devils, on the other hand, disbelieved and taught magic to the people of the Babylon of Harut and Marut.''
Ibn Jarir continued; "If someone asks about explaining this Ayah in this manner, we say that,
﴿ وَٱتَّبَعُواْ مَا تَتۡلُواْ ٱلشَّيَـٰطِينُ عَلَىٰ مُلۡكِ سُلَيۡمَـٰنَۖ ﴾
(They followed what the Shayatin (devils) gave out (falsely) in the lifetime of Sulayman.) means, magic. Solomon neither disbelieved nor did Allah send magic with the two angels. However, the devils disbelieved and taught magic to the people in the Babylon of Harut and Marut, meaning Gabriel and Michael, for Jewish sorcerers claimed that Allah sent magic by the words of Gabriel and Michael to Solomon, son of David. Allah denied this false claim and stated to His Prophet Muhammad that Gabriel and Michael were not sent with magic. Allah also exonerated Solomon from practicing magic, which the devils taught to the people of Babylon by the hands of two men, Harut and Marut. Hence, Harut and Marut were two ordinary men (not angels or Gabriel or Michael).'' These were the words of At-Tabari, and this explanation is not plausible.
Many among the Salaf, said that Harut and Marut were angels who came down from heaven to earth and did what they did as the Ayah stated. To conform this opinion with the fact that the angels are immune from error, we say that Allah had eternal knowledge what these angels would do, just as He had eternal knowledge that Iblis would do as he did, while Allah referred to him being among the angels,
﴿ وَإِذۡ قُلۡنَا لِلۡمَلَـٰٓٮِٕكَةِ ٱسۡجُدُواْ لِأَدَمَ فَسَجَدُوٓاْ إِلَّآ إِبۡلِيسَ أَبَىٰ ﴾
(And (remember) when We said to the angels: "Prostrate yourselves before Adam.'' And they prostrated except Iblis (Satan), he refused) (20:116) and so forth. However, what Harut and Marut did was less evil than what Iblis, may Allah curse him, did. Al-Qurtubi reported this opinion from `Ali, Ibn Mas`ud, Ibn `Abbas, Ibn `Umar, Ka`b Al-Ahbar, As-Suddi and Al-Kalbi.