The Epic of Gilgamesh ends as Gilgamesh is traveling home from his visit with Utnapishtim. Gilgamesh has lost the magic plant that Utnapishtim gave him that conferred eternal youth, and Utnapishtim has told him that an immortal life is not in store for him. When he returns to his city, Uruk, Gilgamesh has a newfound appreciation for the beauty and sturdiness of the walled city he has built. The epic states, "This too was the work of Gilgamesh, the king, who knew the countries of the world. He was wise, he saw mysteries and knew secret things, he brought us a tale of the days before the flood." Gilgamesh returns with a story of life before the flood, and he shares this wisdom with his people.
When Gilgamesh returns from his journey, he also realizes that it is his destiny to rule wisely as a king but not to attain immortality. Enlil, the father of the gods, had said of Gilgamesh's destiny, "You were given the kingship, such was your destiny, everlasting life was not your destiny." Instead of trying to achieve immortality, Gilgamesh turns his efforts to ruling as a wise and just king. He realizes that his destiny is to be great on earth, not in a life of immortality, and he appreciates what he can do as a mortal king.