The first libraries of the world can be traced back to the ancient civilizations of Mesopotamia and Egypt. The ancient Mesopotamians, who lived in what is now modern-day Iraq, are believed to have created the first libraries around 2500 BC. These libraries were collections of clay tablets inscribed with cuneiform script, which were used for record-keeping, literature, and scholarship. The tablets were stored in temples, palaces, and other public buildings, and were used by scribes and scholars to consult and copy texts.
The ancient Egyptians also had libraries, which were collections of papyrus scrolls that contained texts on a variety of subjects, including literature, science, and mathematics. These scrolls were stored in temple libraries and in the libraries of the wealthy. The ancient Greeks and Romans also had libraries, which were important centers of learning and scholarship in their societies. The Library of Alexandria, in Egypt, was one of the most famous libraries of the ancient world, and it is said to have contained hundreds of thousands of scrolls.