Not a god, but a dwarf. From Gylfaginning, section 14:
"The dwarfs had taken shape first and acquired life in the flesh of Ymir and were then maggots, but by decision of the gods they became conscious with intelligence and had the shape of men though they live in the earth and in rocks. Modsognir was a dwarf and the second was Durin. Thus it says in Voluspa:
Then went all the powers to their judgment seats, most holy gods, and deliberated upon this, that a troop of dwarfs should be created from bloody surf and from Blain's bones. There man-forms many were made, dwarfs in the earth as Durin said.
And the names of these dwarfs, says the prophetess, are these:
Nyi, Nidi, Nordri, Sudri, Austri, Vestri, Althiolf, Dvalin, Nar, Nain, Niping, Dain, Bifur, Bafur, Bombor, Nori, Ori, Onar, Oin, Modvitnir, Vig and Gandalf, Vindalf, Thorin, Fili, Kili, Fundin, Vali, Thror, Throin, Thekk, Lit, Vitr, Nyr, Nyrad, Rekk, Radsvinn.
But these are also dwarfs and live in rocks, whereas the previous ones lived in soil:
Draupnir, Dolgthvari, Hor, Hugstari, Hlediolf, Gloin, Dori, Ori, Duf, Andvari, Heptfili, Har, Siar."
This is from the Prose, or Younger, Edda, by Snorri Sturluson. Translated by Anthony Faulkes.
Edit: Oh yeah, forgot to mention -- As one will see, Tolkien put his degrees to good use here, and lifted many a name from Norse sources. His day job, after all, was as professor of Norse and Anglo-Saxon, mostly Anglo-Saxon I believe. I'd recommend his paper on the monsters of Beowulf to anyone interested -- in addition to being a pretty good treatment of the subject, it's a good read, heh.