The poem is divided into two parts: a heroic story about the exploits of a legendary king, and a narrative about a spiritual quest by a man who has just recognized his own mortality. Gilgamesh begins the story as a ruler who wears out his people, who pray to the gods for relief. The gods create Enkidu as an alter-ego for Gilgamesh: half animal, half human and complement to Gilgamesh’s half-human, half-divine nature. Enkidu is civilized by a prostitute who has sex with him, introduces him to shepherds—who teach him to eat human food, wear clothing, and groom himself—and then takes him to meet Gilgamesh. The two wrestle and become fast friends. The pair cements the friendship and seeks lasting fame by going to the cedar forests and killing their guardian, Humbaba, in an anticlimactic action that angers the god Enlil.
The death of Enkidu provides a transition to the second part of the poem. Gilgamesh spurns an offer of marriage from Ishtar, the goddess of love. In retaliation, Ishtar sends the Bull of Heaven against Uruk, but Gilgamesh and Enkidu kill it. The gods decide that the pair of heroes has crossed into forbidden territory and that one of them—Enkidu—must die. Gilgamesh stays by Enkidu until and after he dies; then, frightened by death, he lays aside his regalia and goes out searching for a more literal immortality than a name that will live after him.
The second part of the poem is about the quest for a remedy against death. Gilgamesh travels to the end of the world, crosses over the Ocean of Death, and arrives at the island of Uta-napishti; he and his wife are the only humans ever granted immortality by the gods. Uta-napishti tells Gilgamesh the Mesopotamian version of the story of the Great Flood, in which he built a boat that saved animals and people. As a reward for this act, he was given eternal life; the act will never be repeated for any other human being. Gilgamesh is given a plant that renews one’s youth, but a snake eats it as Gilgamesh is returning to Uruk. Gilgamesh returns home empty-handed but becomes reconciled to the human lot: his own immortality will be the walls of Uruk.
The poem insists that Gilgamesh is a hero not just because of what he did but because of what he learned. The story is also a fall from primeval innocence and union with nature into self-consciousness and the severing of the bond with nature. Gilgamesh’s story is about coming to terms with mortality. As part of his maturation process, Gilgamesh comes to see everything in a new way and better understands who he is and what he can accomplish. The poem also encourages one to find time for some civilized pleasures throughout life.