he was a wizard. that is what the elves called these five ol geezers who turned up at the end of the second age. we only know the names of three, saruman, gandalf and rhadagast. these people appeared to be old men but were apparently immortal and were known to the high elves as lesser valar (middle earth version of angels) who were sent to middle earth from valinor to help out against sauron but forbidden from taking their own form.
he was of the maia which are servants of the valar in the undying lands .he was sent to middle-earth to help in the fight against sauron with 4 others of his kind(radagast,saruman,and the 2 blue wizards)
Also the Balrog was a maia (they followed melkor and sauron in the first age)
Tolkein described it like this...
One "god" called Eru, who had "angels".
All "angels" are described as "Ainur"
There are two "angelic" types of being mentioned, the Valar and the Maiar.
The Valar are a higher order than the Maiar.
The Valar sent five of the Maiar to Middle Earth, these became known as the Istari, which in "the common tongue" were know as Wizards.
So darth vader... Maiar, Wizards and Istari are all right, and the Valar were their bosses back "over the sea".