The Epic of Gilgamesh was written in Babylonia around 2100 B.C., several centuries after the life of its protagonist, the Sumerian king Gilgamesh, who ruled Uruk during the mid-2000s B.C. The epic, artfully compiled from earlier folktales, tells of the powerful and egocentric Gilgamesh, who through his arrogance manages to offend the gods. The gods seek vengeance by sending a wild man from the steppe named Enkidu to kill him. Instead, Gilgamesh and Enkidu become friends and journey together; however, Enkidu is later killed at the behest of the gods, and Gilgamesh is forced to confront the inevitability of his own death. In his sorrow, Gilgamesh searches for immortality but in vain. Though Gilgamesh fails in his quest, through his interactions with the gods and his trials, he achieves wisdom and an understanding of life.
In a way, the line between gods and humans in the epic is not a sharp one. Gods, demigods, and humans interact on a material (and sometimes spiritual) plane, and all have similar emotions and vices. The main feature separating the gods from humans is immortality. But can humans achieve immortality? This question is not addressed explicitly in the epic, leaving the question up to our interpretation and consideration.