Gilgamesh was a major hero in ancient Mesopotamian mythology and the protagonist of the Epic of Gilgamesh, an epic poem written in Akkadian during the late 2nd millennium BC. He was likely a historical king of the Sumerian city-state of Uruk, who was posthumously deified. His rule probably would have taken place sometime in the beginning of the Early Dynastic Period (Mesopotamia), though he became a major figure in Sumerian legend during the Third Dynasty of Ur.