The mid-nineteenth century was a time when very many Western people began to doubt the historical truth of the Bible. Was it really the case that we were all descended from Adam and Eve, whom God created in his own image and placed in a beautiful garden and then, by reason of their sins, banished from there? Did their descendants compound their wickedness, to the point where God decided to drown them all, in a huge flood? And did he, afterward, seeing the destruction he had wrought, make a covenant with the one surviving family, that of Noah, promising that he would never again raise his hand against his creation? “While the earth remaineth,” he decided, according to the King James Bible, “seedtime and harvest, and cold and heat, and summer and winter, and day and night shall not cease.” For many centuries, this story comforted people. Though we might sin, we could hope for God’s mercy, because that’s what he had promised to Noah.

By the early eighteen-hundreds, however, scholars from various young fields—geology, archeology, paleontology—were producing evidence that the earth was much older than anyone had thought, and that human societies had existed long before the dates assigned to the Creation and the Flood. In 1859, Charles Darwin, in his “Origin of Species,” put forth a theory suggesting that human beings might be descended not from Adam and Eve but from lower animals, things with fur. Not surprisingly, such ideas encountered vigorous opposition. Many scientists and scholars redoubled their efforts to find evidence of the truth of the Bible.

Around the time that Darwin was writing his book, a young Londoner, George Smith, who had left school at the age of fourteen and was employed as an engraver of banknotes, became fascinated by reports of artifacts that were being turned up by explorers in what is today Iraq and sent to England. As David Damrosch writes in “The Buried Book” (2007), Smith spent his lunch hours at the British Museum, studying its holdings. The staff eventually noticed him, and, in 1866, the management hired him, to help analyze the tens of thousands of clay shards that had been shipped there years earlier and had been sitting around in the museum’s storage boxes.

The site they came from was Nineveh, an important city in ancient Mesopotamia, and the reason so many tablets had been found in one place was that they were the remains of a renowned library, that of Ashurbanipal, a king of the neo-Assyrian Empire in the seventh century B.C. When the tablets were first dug up, no one could read the curious-looking script, later called cuneiform, in which they were written. Scholars worked on it for decades.

Now George Smith joined the hunt. He studied the shards for around ten years, and it was he who found the most famous passage inscribed on them, an account of a great flood wiping out almost all of humanity, with one man’s family surviving. When he read this, we are told, he became so excited that he jumped out of his chair and ran around the room, tearing off his clothes. This ancient document could support the truth of Genesis, or so it seemed to Smith.

And to others. In 1872, when Smith presented his findings to the Society of Biblical Archaeology, even William Gladstone, the Prime Minister, was in attendance. The discovery became front-page news across Europe and the United States. Soon, London’s Daily Telegraph gave Smith a grant to go to the region to see if he could add to his findings. Within days, he hit pay dirt—a shard that appeared to complete the flood story—and the British Museum financed two further trips for him. On the second of these, he died of dysentery in Aleppo, at the age of thirty-six. He never lived to understand that, in fact, he had not proved the truth of the Old Testament with his clay tablet. (Both flood narratives could have been descended from older sources, quite possibly fictional.) He had done something else, though. He had discovered what was then, and still is, the oldest long poem in the world, “Gilgamesh.”

The poet and scholar Michael Schmidt has just published a wonderful book, “Gilgamesh: The Life of a Poem” (Princeton), which is a kind of journey through the work, an account of its origins and discovery, of the fragmentary state of the text, and of the many scholars and translators who have grappled with its meaning. Schmidt encourages us to see “Gilgamesh” not as a finished, polished composition—a literary epic, like the Aeneid, which is what many people would like it to be—but, rather, something more like life, untidy, ambiguous. Only by reading it that way, he thinks, will we get close to its hard, nubbly heart.

We meet Gilgamesh in the first line. He is the King of Uruk, a splendid, high-walled city in southern Mesopotamia. His mother was a goddess and his father a mortal. Accordingly, he is a fine specimen of a man, eleven cubits (seventeen feet) tall and four cubits from nipple to nipple. He is not an exemplary ruler, however. He wearies the young men of his city in athletic contests, and when they marry he insists on the droit du seigneur: he, not the groom, spends the wedding night with the bride.

The people of Uruk complain to the gods about Gilgamesh’s behavior, and in response the mother goddess, Aruru, pinches off a piece of clay and, from it, fashions a new person, Enkidu, to be a friend to Gilgamesh and distract him from his bad habits. Enkidu is a giant, too, though not as big as Gilgamesh. In the beginning, he is much like an animal. His body is covered with hair. He runs with the gazelles and drinks with them, on all fours, at the water hole. But he has human intelligence; he regularly releases his animal companions from traps. When one of the local trappers objects that Enkidu is interfering with his livelihood, he is instructed to bring a temple prostitute, Shamhat, to the water hole that Enkidu frequents and have her sit at the edge. (There were such beings as temple prostitutes, devotees of local fertility goddesses, in many ancient societies. This was a respected profession.) Enkidu arrives. Shamhat spreads her legs, and he instantly succumbs. With what must be the most robust erection in literature, he engages Shamhat in an uninterrupted act of coitus for six days and seven nights. Then he gets tired, and Shamhat takes him to a shepherds’ encampment. For the first time in his life, he eats bread. He also drinks seven goblets of beer, and he starts to sing. But when he tries to rejoin the gazelles, they shun him. Tragedy thus enters “Gilgamesh.” Through making love with a human being and eating human food, Enkidu has become a man, and nothing will ever be the same for him.

For example, he now has morals. When he hears about Gilgamesh’s exercise of the droit du seigneur, he becomes enraged. He goes to Uruk and draws Gilgamesh into a fight. The door jambs shake, the walls quake, but after a while the two men weary of the quarrel and decide to be friends. Gilgamesh introduces Enkidu to his mother, the goddess Ninsun. She doesn’t like him. Who are his people? she asks. Thus snubbed, Enkidu weeps, and Gilgamesh, to cheer him up, proposes an adventure: the two of them will go to the Forest of Cedar, kill its protector, the monster Humbaba, and harvest some cedar wood for building projects in Uruk.