Gilgamesh is the King of Uruk. His father is mortal and his mother is a goddess. However, because he is part mortal, Gilgamesh must eventually die, as he discovers and comes to accept during the course of the story.
Gilgamesh is a bad ruler; he treats his people cruelly and even takes away children from their families. His subjects ask the gods for help, and the gods have the goddess Aruru create a man, Enkidu, who will be almost Gilgamesh's equal. Enkidu is supposed to reform Gilgamesh; get him to change his ways.
Enkidu comes to life in the wilderness. He is covered with hair, shaggy, wild like the wilderness. He eats grass with the gazelles and drinks water with the animals. A trapper is frightened by the sight of Enkidu and asks his father what to do, because Enkidu is freeing animals from the traps.
His father advises him to go to Uruk, find Gilgamesh, and tell him of the wild man. Gilgamesh sends a woman to tame Enkidu and teach him the ways of civilization, such as wearing clothing, eating bread and drinking wine. Then she tells him of the strength of Gilgamesh. Enkidu wants to meet and challenge Gilgamesh to a contest of strength.
Enkidu hears how Gilgamesh is mistreating all the people of Uruk, and he is shocked. He now wants to challenge Gilgamesh to conquer him and force him to behave properly. They struggle like equals, but finally Gilgamesh throws Enkidu, who loses his anger and recognizes Gilgamesh as a true king. They embrace and become best friends.
Gilgamesh longs to perform great deeds, so his name will be remembered. He wants to go to the cedar forest and slay its guardian monster, Humbaba. Enkidu is terrified, because he knows Humbaba, but Gilgamesh insists, and they prepare for the journey.
Enkidu's hand is paralyzed when he touches the cedar forest gate, but Gilgamesh helps him to continue. They have disturbing dreams, but nonetheless cut down a cedar tree. Humbaba approaches and they fight; Humbaba begs for his life, but they cut off his head.
Gilgamesh washes himself and puts on clean clothes and his crown. He is so attractive that Ishtar, the goddess of love, wants to marry him. He refuses, quite rudely, pointing out how she had ruined the lives of her previous husbands. Ishtar is hurt and furious and she goes to her father, Anu, demanding that he send the Bull of Heaven (drought) to punish Gilgamesh. She threatens to smash down the gates to the underworld if her father does not comply. Anu sends the Bull of Heaven, but Enkidu catches it by the horns, and Gilgamesh kills it.
Unfortunately, as Enkidu discovers in a dream, the gods are holding a council to determine who should die for these attacks on divinity: Gilgamesh or Enkidu. Naturally, since Gilgamesh is part divine and part human, while Enkidu is part human and part animal, the sacrifice, the judgment falls on Enkidu, who sickens and dies.
Gilgamesh is distraught with grief and denial of death. First he keeps the body of Enkidu for a week, until the body became wormy. Then, he had him buried and wandered out from Uruk into the wilderness as a wild hunter, dressed in animal skins. Gilgamesh despairs for the loss of Enkidu, but also for his own death, which he now understands must come some day. Seeking to avoid death, Gilgamesh looks for Utnapishtim, the only human being who was granted eternal life by the gods. He wants to learn the secret of how to avoid death.
Eventually, Gilgamesh comes to the entry to the land of the gods, an other-world, which is under a mountain, guarded by a Man-scorpion and his mate. Gilgamesh gains entrance to the mountain and travels for leagues in the dark until he arrives in the jeweled garden of the gods.
Gilgamesh continues in his search for Utnapishtim and the secrets of life and death. He meets a divine wine-maker, Siduri, who gives him shelter and advises him to accept his human fate and enjoy life while he can. But he insists that he must find Utnapishtim, so she tells him that the boatman Urshanabi can take him across the Sea of Death to the place where Utnapishtim lives with his wife.
After a complicated boat-trip, Urshanabi brings Gilgamesh to Utnapishtim, who tells his story. It is the story of the Flood (remarkably similar to the Flood story in Genesis). The point is, the Flood was a one time ever event, will never occur again, and the only reason Utnapishtim and his wife are now immortal is because the gods chose to make them so after they survived the flood. The final blow to Gilgamesh here is seven loaves of bread which Utnapishtim's wife made, one each day that Gilgamesh slept. He could not even stay awake for seven days; how could he ever hope to live forever?
Utnapishtim's wife takes pity on Gilgamesh and asks her husband to tell him about the plant that can make him young again, if not immortal. Gilgamesh dives into the sea to pick the plant, but loses it later, while bathing, because a snake slithers up and eats it.
Gilgamesh returns to Uruk with the boatman Urshanabi, and points out to him the mighty walls; this is the proper work of a human being, not the search for eternal life. Gilgamesh returns to his duties as king and now is a much kinder and truly great ruler.
The final segment of the story tells of the death of Gilgamesh and the mourning for him of all the people of Uruk.