Gilgamesh[a] was a historical king of the Sumerian city-state of Uruk, a major hero in ancient Mesopotamian mythology, and the protagonist of the Epic of Gilgamesh, an epic poem written in Akkadian during the late second millennium BC. He probably ruled sometime between 2800 and 2500 BC and was posthumously deified. He became a major figure in Sumerian legends during the Third Dynasty of Ur (c. 2112 – c. 2004 BC). Tales of Gilgamesh's legendary exploits are narrated in five surviving Sumerian poems. The earliest of these is probably Gilgamesh, Enkidu, and the Netherworld, in which Gilgamesh comes to the aid of the goddess Inanna and drives away the creatures infesting her huluppu tree. She gives him two unknown objects called a mikku and a pikku, which he loses. After Enkidu's death, his shade tells Gilgamesh about the bleak conditions in the Underworld. The poem Gilgamesh and Agga describes Gilgamesh's revolt against his overlord King Agga. Other Sumerian poems relate Gilgamesh's defeat of the ogre Huwawa and the Bull of Heaven and a fifth, poorly preserved one apparently describes his death and funeral.
In later Babylonian times, these stories began to be woven into a connected narrative. The standard Akkadian Epic of Gilgamesh was composed by a scribe named Sîn-lēqi-unninni, probably during the Middle Babylonian Period (c. 1600 – c. 1155 BC), based on much older source material. In the epic, Gilgamesh is a demigod of superhuman strength who befriends the wildman Enkidu. Together, they go on adventures, defeating Humbaba (the East Semitic name for Huwawa) and the Bull of Heaven, who, in the epic, is sent to attack them by Ishtar (the East Semitic equivalent of Inanna) after Gilgamesh rejects her offer for him to become her consort. After Enkidu dies of a disease sent as punishment from the gods, Gilgamesh becomes afraid of his own death, and visits the sage Utnapishtim, the survivor of the Great Flood, hoping to find immortality. Gilgamesh repeatedly fails the trials set before him and returns home to Uruk, realizing that immortality is beyond his reach.
Most classical historians agree that the Epic of Gilgamesh exerted substantial influence on both the Iliad and the Odyssey, two epic poems written in ancient Greek during the eighth century BC. The story of Gilgamesh's birth is described in a second-century AD anecdote from On the Nature of Animals by the Greek writer Aelian. Aelian relates that Gilgamesh's grandfather kept his mother under guard to prevent her from becoming pregnant, because he had been told by an oracle that his grandson would overthrow him. She became pregnant and the guards threw the child off a tower, but an eagle rescued him mid-fall and delivered him safely to an orchard, where he was raised by the gardener. The Epic of Gilgamesh was rediscovered in the Library of Ashurbanipal in 1849. After being translated in the early 1870s, it caused widespread controversy due to similarities between portions of it and the Hebrew Bible. Gilgamesh remained mostly obscure until the mid-twentieth century, but, since the late twentieth-century, he has become an increasingly prominent figure in modern culture.
Most historians generally agree that Gilgamesh was a historical king of the Sumerian city-state of Uruk, who probably ruled sometime during the early part of the Early Dynastic Period (c. 2900 – 2350 BC).Stephanie Dalley, a scholar of the ancient Near East, states that "precise dates cannot be given for the lifetime of Gilgamesh, but they are generally agreed to lie between 2800 and 2500 BC." No contemporary mention of Gilgamesh has yet been discovered, but the 1955 discovery of the Tummal Inscription, a thirty-four-line historiographic text written during the reign of Ishbi-Erra (c. 1953 – c. 1920 BC), has cast considerable light on his reign. The inscription credits Gilgamesh with building the walls of Uruk. Lines eleven through fifteen of the inscription read:
For a second time, the Tummal fell into ruin,
Gilgamesh built the Numunburra of the House of Enlil.
Ur-lugal, the son of Gilgamesh,
Made the Tummal pre-eminent,
Brought Ninlil to the Tummal.
Gilgamesh is also referred to as a king by King Enmebaragesi of Kish, a known historical figure who may have lived near Gilgamesh's lifetime. Furthermore, Gilgamesh is listed as one of the kings of Uruk by the Sumerian King List. Fragments of an epic text found in Me-Turan (modern Tell Haddad) relate that at the end of his life Gilgamesh was buried under the river bed. The people of Uruk diverted the flow of the Euphrates passing Uruk for the purpose of burying the dead king within the river bed.