The Epic of Gilgamesh, an epic poem from Mesopotamia, is amongst the earliest surviving works of literature. The literary history of Gilgamesh begins with five independent Sumerian poems about 'Bilgamesh' (Sumerian for Gilgamesh), king of Uruk. Four of these were used as source material for a combined epic in Akkadian. This first, “Old Babylonian” version of the epic dates to the 18th century BC and is titled Shūtur eli sharrī (“Surpassing All Other Kings”). Only a few fragments of it survive. The later, Standard Babylonian version dates from the 13th to the tenth centuries BC and bears the title Sha naqba īmuru (“He who Saw the Deep”). Fragments of approximately two thirds of this longer, twelve-tablet version have been recovered. Some of the best copies were discovered in the library ruins of the 7th-century BC Assyrian king Ashurbanipal.
The story centers on a friendship between Gilgamesh and Enkidu. Enkidu is a wild man created by the gods as Gilgamesh's equal to distract him from oppressing the people of Uruk. Together, they journey to the Cedar Mountain to defeat Humbaba, its monstrous guardian. Later they kill the Bull of Heaven, which the goddess Ishtar sends to punish Gilgamesh for spurning her advances. As a punishment for these actions, the gods sentence Enkidu to death.
The later half of the epic focuses on Gilgamesh's distress at Enkidu's death, and his quest for immortality. In order to learn the secret of eternal life, Gilgamesh undertakes a long and perilous journey to find the immortal flood hero, Utnapishtim. He learns that “The life that you are seeking you will never find. When the gods created man they allotted to him death, but life they retained in their own keeping.” His fame however lived on after his death, because of his great building projects, and his account of what Utnapishtim told him happened during the flood.
Various themes, plot elements, and characters in the Epic of Gilgamesh have counterparts in the book of Genesis, notably in the stories of the Garden of Eden and Noah's Flood.
The parallels between the stories of Enkidu/Shamhat and Adam/Eve have been long recognized by scholars. In both, a man is created from the soil by a god, and lives in a natural setting amongst the animals. He is introduced to a woman who tempts him. In both stories the man accepts food from the woman, covers his nakedness, and must leave his former realm, unable to return. The presence of a snake that steals a plant of immortality from the hero later in the epic is another point of contact.