And [mention] when We said to the angels, "Prostrate before Adam"; so they prostrated, except for Iblees.1 He refused and was arrogant and became of the disbelievers.
Translation: Saheeh International (English)
1 The proper name of Satan, who was not an angel but from the jinn, as stated in 18:50. Done in obedience to Allāh, this prostration was one of respect, not worship.
Allah reveals that He told the angels to prostrate to Adam out of recognition and respect, so they prostrated to him, eager to do as He told them, except for Iblīs, or Satan, who was originally from the jinn. Due to the excellence of his worship, Allah had entered Iblīs into the company of the angels; but he then returned to his lowly nature, refusing to prostrate as Allah told him to, and becoming proud towards Adam, leading to him becoming a disbeliever.