All Qur'anic characters

The unseen (al-ghayb)

Hārūt and Mārūt

Two angels in Babylon through whom people were tested.

The story

A test in Babylon

In Babylon, two angels — — were a means of testing people. They taught no one until they had warned: we are only a trial, so do not disbelieve. Ibn Kathīr explains that some people learned from them what sows discord between a man and his wife, but they could harm no one except by Allah's permission.

Learning what harms

The passage concludes that those who bought such knowledge had no share in the Hereafter, and that they sold their souls for an evil price, had they only known. Ibn Kathīr explains that the account warns against magic entirely: it is disbelief, however it is dressed.

What we learn

Not all knowledge is a blessing

Some learning is itself a trial. The angels warned before teaching — the subject was dangerous by nature, and seeking it was a choice with a price.

Nothing harms except by Allah's permission

Even the harm of magic operates only within Allah's will. Fear belongs to Allah alone, not to practitioners of any craft.

The takeaway

mark the Qur'an's warning against magic: a trial sent to a people, clearly labelled as a trial, and bought only at the price of the Hereafter.

Sources

Summaries of Ibn Kathīr's commentary on the linked āyāt, with authentic ḥadīth noted in the text where used. Verse links open Quran.com text and your chosen translation.