Is Devil Jinn or An Angel?

Was Devil of the Jinn or angels? If he was an angel, how did he rebel against God?

“And (remember) when We said unto the angels: Fall prostrate before Adam, and they fell prostrate, all save Iblis. He was of the jinn, so he rebelled against his Lord's command. Will ye choose him and his seed for your protecting friends instead of Me, when they are an enemy unto you? Calamitous is the exchange for evil-doers. (Surah al-Kahf, 50)
There is a consensus among Muslim scholars that Iblis was not an angel. This issue can be explained as the following:

Allah (cc) states clearly in the Qur’an that the Iblis (Devil) is a Jinni

The following ayahs state quite obviously that Devil is of the jinn, not of the angels:
“He (Satan) was of the jinn, so he rebelled against his Lord's command.” (Surah al-Kahf, 50)
“And on the day when He (Allah swt) will gather them all together, He will say unto the angels: Did these worship you?
They will say: Be Thou Glorified. Thou (alone) art our Guardian, not them! Nay, but they worshipped the jinn (Satan); most of them were believers in them.” (Surah al-Saba, 40-41)
Scholars say: “If it is definite that the devil is of the jinn, he can’t be of the angels; because jinn is a different kind from angels” (Fahraddin Razi, Tafsirul Kabir)

Iblis which was created from fire is a different kind from angels

Iblis, was created from fire but angels were not. Quran states that;
“… (Iblis) said: I am better than him. Thou createdst me of fire while him Thou didst create of mud. (el-Araf 12)
“He was of the jinn, so he rebelled against his Lord's command.”(Surah al-Kahf 50)
Jinns was also created of fire, Because Allah (swt) states:
“And the jinn did We create aforetime of essential fire.”(al-Hijr 27)
“He created man of clay like the potter's, And the jinn did He create of smokeless fire. (Surah al-Rahman, 14-15)
Angels were created from noor (light), not from fire. Zuhri narrated from Urve and Urve narrated from Hadrat Aisha (ra) that Prophet Muhammad (Pbuh) says;
“Angels (Malaika) were created from noor; However “Jinn” was created of smokeless fire.” (Fahraddin Razi, Tafsirul Kabir)

Iblis’s having progeny demonstrates that he cannot be of angels

“Iblis has progeny but angels do not. The following verse obviously demonstrates that Iblis has progeny:
“And (remember) when We said unto the angels: Fall prostrate before Adam, and they fell prostrate, all save Iblis. He was of the jinn, so he rebelled against his Lord's command. Will ye choose him and his seed for your protecting friends instead of Me, when they are an enemy unto you ? Calamitous is the exchange for evil-doers.” (Surah al-Kahf, 50)
Hasan Basri (ra)'sstatement about this issue is narrated as following:
“Iblis has never been of the angels. As Adam (pbuh), is the origin of mankind, iblis is the origin of the jinn. Besides, like humans, the jinn reproduce through birth. (Tafsir al-Tabari)
“And they make the angels, who are the slaves of the Beneficent, females. Did they witness their creation? Their testimony will be recorded and they will be questioned.” (Surah Az-Zukhruf, 19)
As stated in the ayah, angels have no gender. Since reproduction occurs through male and female, angels do not reproduce; therefore they have no progeny." (Fahraddin Razi, Tafsirul Kabir)

Since Iblis was in the heaven together with the angels and was commanded to prostrate to Adam with them, he was supposed to have been of angels; however his rebellion against the commandment demonstrates that he is not of angels

Before Adam was created, Iblis, through his worship, had raised to the seventh level of heaven as the gatekeeper of Paradise (jannah).
It was supposed that Iblis was of the angels due to his being in Heaven (Jannah) together with angels and receiving the order “prostrate before Adam” from Allah (swt).
Thereafter, due to the arrogance he kept inside, he was tested through the commandment of prostration before Adam. When he refused to prostrate, he was expelled from the holy mercy and became the sworn enemy of mankind.

Iblis has nafs and he chose to rebel against Allah (swt); however angels don’t have nafs and they never disobey. This proves that iblis can’t be of angels.

“And (remember) when We said unto the angels: Fall prostrate before Adam, and they fell prostrate, all save Iblis. He was of the jinn, so he rebelled against his Lord's command.” (Surah al-Kahf, 50)
As stated above, angels are innocent (creatures) and they do whatever Allah (swt) commands them; however Iblis is not like that. Therefore he can’t be of the angels. If he was of the angels he would not have rebelled against Allah (swt). Because Allah (swt) says about angels that;
“O ye who believe! Ward off from yourselves and your families a Fire whereof the fuel is men and stones, over which are set angels strong, severe, who resist not Allah in that which He commandeth them, but do that which they are commanded.” (Surah al-Tahrim, 6)
(Tafsir al-Tabari)

Angels are the reliable messengers of Allah (swt), Iblis is not

Angels are the messengers; because Allah (swt) stated:
“Praise be to Allah, the Creator of the heavens and the earth, Who appointeth the angels messengers having wings two, three and four. (Surah al-Fatr, 1)
Allah’s messengers are innocent as he following ayah indicates:
“Allah knoweth best with whom to place His message.” (Surah Al- An’am, 124
Since Iblis does not have these characteristics, he can’t be of angels. (Fahraddin Razi, Tafsirul Kabir)