The Epic of Gilgamesh is an epic poem from ancient Mesopotamia that is often regarded as the earliest surviving great work of literature and the second oldest religious text, after the Pyramid Texts. The literary history of Gilgamesh begins with five Sumerian poems about Bilgamesh (Sumerian for "Gilgamesh"), king of Uruk, dating from the Third Dynasty of Ur (c. 2100 BC). These independent stories were later used as source material for a combined epic in Akkadian. The first surviving version of this combined epic, known as the "Old Babylonian" version dates to the 18th century BC and is titled after its incipit, Shūtur eli sharrī ("Surpassing All Other Kings"). Only a few tablets of it have survived.

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.

More Info: en.wikipedia.org