In the fictional world of Middle-earth, Ungoliant (from Quenya ungwë liante: "gloomweaver"; Gwerlum in Sindarin) was an evil spirit in the form of a spider who dwelt in Avathar in the First Age. It is thought that she may have been one of the Maiar whom Melkor corrupted long ago, but she is not listed among the Ainur. The name is pronounced (International Phonetic Alphabet).
Ungoliant aided Melkor in his attack on the Two Trees of Valinor; she drained the Trees of their sap and poisoned them after Melkor wounded them, and she drained dry the Wells of Varda, so that nothing remained of the Light that was before Sun or Moon, except in the Silmarils of FŽanor. She and Melkor fled to Middle-earth to escape justice at the hands of the Valar.
Melkor had promised to reward her, "Yea, with both hands", and after their flight from Valinor, the Dark Lord indeed gave her many gems of the —oldor, but withheld the Silmarils in his right hand. He refused to give them to the Great Spider to be devoured, for he desired them greatly, and Ungoliant would have slain Melkor in the ensuing battle had not the Balrogs come and saved their master, causing Ungoliant to flee to the Ered Gorgoroth in Beleriand.
While there, she had many offspring, as well as various creatures infesting the Ered Gorgoroth, which came to be a place of horror. The dates of her existence are not precisely known; in The Silmarillion, Quenta Silmarillion, Chapter 9, Of the Flight of the Noldor, we are told that she "went whither she would into the forgotten south of the world" shortly before the First Age, and that "some have said that she ended long ago, when in her uttermost famine she devoured herself at last."
The great spiders of The Hobbit and The Lord of the Rings (including Shelob and the spiders encountered by Bilbo Baggins in Mirkwood) were descendants of Ungoliant.
The name Ungoliant is partly derived from the root ungol ("spider"), which also occurs in Cirith Ungol, where Shelob resided in the Third Age.