This puzzled me for a while.
As far as Islam goes the dominate opinion is that he was a Jinn (ghost-like/demon) who because of his piety was with the Angels. When he refused to bow down to Adam (upon him peace), he was expelled from Heaven, to earth.
There is another opinion that he was an angel but that doesn't make sense for me. As an angel has no other purpose but to obey God, it therefore cannot disobey God. He has to be from the Jinn to have this ability to disobey like Humans do.
So for me he is a jinn not an angel.