Ashurbanipal built the famous library at Nineveh containing thousands of clay tablets. He ruled the Neo-Assyrian Empire from 668 to about 631 BCE and is known as one of the ancient Near East’s most scholarly kings.
The library preserved royal copies and collected texts on mythology, divination, medicine, rituals, grammar, mathematics, and omens. Among its best-known works is a version of the Epic of Gilgamesh, including the flood narrative associated with Utnapishtim. Tablets were written mainly in Akkadian, with important Sumerian texts as well.
The collection was not a public library in the modern sense. It served the king, court scholars, and the administration of the empire. Many tablets survived because Nineveh was destroyed and the clay documents were baked hard by the fires around 612 BCE, when the city fell to a coalition of enemies.