He is a Maia, a spirit who helped forge the world in the beginning of time. Basically the Valar, the greater spirits, are like gods and the Maiar are more like demigods or lesser gods, though some, like Sauron, could very well challenge the Valar in terms of power. Gandalf and the istari are also Maiar and Sauron's used-to-be master Morgoth was a Vala.