Ancient Egypt has persisted in the popular imagination for more than 400 years, from Shakespeare's "Antony and Cleopatra" to Lawrence Kasdan's "Raiders of the Lost Ark." And it's easy to see why, starting with the almost unfathomable scale of its pyramids and other monuments, many of which are still standing thousands and thousands of years after they were built.

Overwriting everything, often quite literally, are hieroglyphs, communication via tiny works of art that for centuries no one could read. Conventional wisdom held (incorrectly) that hieroglyphs concealed "not mundane messages but profound and universal truths." Then in 1799, Napoleonic troops in Egypt found a stone slab covered with text in three scripts — Greek, demotic and hieroglyphic. The Rosetta Stone, as it came to be called, would be the key that unlocked and demystified all those messages adorning innumerable Egyptian artifacts.

But as Edward Dolnick's meticulous new book, "The Writing of the Gods," lays out, the process of decoding the Rosetta Stone's 14 lines of hieroglyphs was not easy. At the heart of this sprawling account full of astonishing takeaways are two "rival geniuses," Thomas Young and Jean-François Champollion. Young, an English polymath, became interested in the Rosetta Stone simply because it was there, an unsolved problem. The Frenchman Champollion only ever had eyes for Egypt, in all its manifestations, including the ancient language of Coptic that would prove crucial to understanding the Rosetta Stone.

Dolnick treats their efforts like a thriller, with both men making game-changing breakthroughs, benefiting from shrewd guesses, and being hampered by preconceptions or bad luck.

While the codebreaking chapters captivate, the supporting material — covering the development of writing, the history and culture of ancient Egypt, Napoleon's military campaigns in the region, the academic milieu of the early 19th century and more — can be every bit as entertaining. Dolnick is a diligent researcher, drawing his account from an extensive bibliography and enlisting scores of historical figures from pharaohs to philosophers. He can be didactic and tends to overdo it on the metaphors explaining the challenges confronting Young and Champollion, but he seems genuinely awed by his subject, reflecting on humanity's approach to knowledge, how we judge discovery, and why we either venerate or denigrate what we do not understand.

It is indeed a remarkable tale, starting with the fact that the Rosetta Stone was ever even found. Initially created as a propaganda poster for Ptolemy V in some temple in 196 BC, the stone was reused as building material for a fort, then languished for centuries in a rubble heap, preserved by Egypt's arid heat. Were it not for Napoleon's expansionist ego and intellectual curiosity — he brought 160 scientists, artists and scholars with him — it might never have been plucked out. Considering the transience of today's society and the damage we are inflicting on each other and the planet, it's fair to wonder what will be left thousands of years from now to help those who may remain try to learn what we have done.

Cory Oldweiler is a freelance writer and editor.

Title: The Writing of the Gods

By: Edward Dolnick.

Publisher: Scribner, 336 pages, $28.