There are several different versions of Mesopotamian creation myths, but all follow generally the same pattern. The god Enlil separates the heavens and the earth. Enlil rules the earth, while the god Anu rules the sky and the god Enki rules the waters. Enlil tries to assign junior gods to do labor, but they refuse. The gods then decide to create humans to do work for the gods instead, and the goddess Namma creates the first humans out of clay.
The gods decide to supply humans with grain and sheep, so they become farmers. To avoid chaos, Enki organizes the world, assigning gods to oversee the waters, crops, building activities, wildlife, the herding of animals, and the activities of women. Enki also created the Tigris and Euphrates rivers to provide water, and he created kingship and rule over foreign countries.
The Flood
But soon the god Enlil becomes unhappy when the human population grows rapidly. At first he tries to limit human growth with a famine, but when that does not work, he decides to send a flood instead. Enki decides to warn the human Utnapishtim about the impending flood, telling him to abandon wealth and use the wood from his house to build a boat. Utnapishtim builds a boat for his family and certain animals, surviving the flood. He then makes an offering to the gods, and Enki chastises Enlil for trying to bring about the end of humanity. Enlil agrees that Utnapishtim and his wife will be granted immortality. They will control overpopulation by limiting the human lifespan and by making some women infertile.
Years later, the king of the city of Uruk—Gilgamesh—has grown into an arrogant king hated by the people, so the gods create the "wild man" Enkidu to challenge him and end his oppressive rule. Enkidu lives among the animals but is lured the city and taught the ways of civilization. Enkidu then goes to confront Gilgamesh and the two fight. Enkidu loses, but he and Gilgamesh become close friends. Gilgamesh becomes obsessed with finding eternal life, so he and Enkidu embark on a journey. Along the way, the two anger the gods, so they curse Enkidu with illness and he dies. Devastated, Gilgamesh seeks out Utnapishtim—the only many to be granted immortality—in hopes of discovering the secret to immortality.
Utnapishtim tells Gilgamesh the story of the flood and tells Gilgamesh he has no power to grant another man immrtality. But he offers him a chance to earn it. First, he must show himself worthy by staying awake for six days and nights, which he fails at. Convinced to show Gilgamesh mercy, Utnapishtim then directs him to a magic plant which, in a moment of carelessness, Gilgamesh leaves on the shore of a lake while he bathes, and it is eaten by a snake. Gilgamesh is forced to return to Uruk a mere mortal. However, his heroic exploits on his journey with Enkidu and his great building projects he undertakes for Uruk earn him fame well after death.