[Linked in Mark Morford's column today, and also mentioned in Joan Acocella's nice essay on the Mary Magdalene....]
The Nag Hammadi library is a collection of early Christian Gnostic texts discovered in the town of Nag Hammadi in 1945. That year, thirteen leather-bound papyrus codices buried in a sealed jar were found by local peasants. The writings in these codices comprised fifty-two mostly Gnostic tractates (treatises), but they also include three works belonging to the Corpus Hermeticum and a partial translation / alteration of Plato's Republic. The codices are believed to be a library hidden by monks from the nearby monastery of St Pachomius when the possession of such banned writings denounced as heresy was made an offense. The zeal of Athanasius in extirpating non-canonical writings and the Theodosian decrees of the 390s may have motivated the hiding of such dangerous literature.
The contents of the codices were written in Coptic, though the works were probably all translations from Greek. Arguably the most well-known of these works is probably the Gospel of Thomas, of which the Nag Hammadi codices contain the only complete text. After the discovery it was recognized that fragments of these sayings of Jesus appeared in manuscripts discovered at Oxyrhynchus in 1898, and quotations were recognized in other early Christian sources. A 1st or 2nd century date of composition for the lost Greek originals has been proposed, though this is disputed. The manuscripts themselves date from the 3rd and 4th centuries.
The story of the discovery of the Nag Hammadi library in 1945 has been described as 'exciting as the contents of the find itself' (Markschies, Gnosis: An Introduction, 48). In December of that year, two Egyptian brothers found several papyri in a large earthernware vessel while digging for fertilizer around limestone caves near present-day Habra Dom in Upper Egypt. The find was not initially reported by either of the brothers, who sought to make money from the manuscripts by selling them individually at intervals. It is also reported that the brothers' mother burned several of the manuscripts, worried, apparently, that the papers might have 'dangerous effects' (Markschies, Gnosis, 48). As a result, what came to be known as the Nag Hammadi library (owing to the proximity of the find to Nag Hammadi, the nearest major settlement) appeared only gradually, and its significance went unacknowledged until some time after its initial uncovering.
In 1946, the brothers became involved in a feud, and left the manuscripts with a Coptic priest, whose brother-in-law in October that year sold a codex to the Coptic Museum in Old Cairo (this tract is today numbered Codex III in the collection). The resident Coptologist and religious historian Jean Dorese, realising the significance of the artifact, published the first reference to it in 1948. Over the years, most of the tracts were passed by the priest to a Cypriot antiques dealer in Cairo, thereafter being retained by the Department of Antiquities, for fear that they would be sold out of the country. After the revolution in 1956, these texts were handed to the Coptic Musuem in Cairo, and declared national property.
Meanwhile, a single codex had been sold in Cairo to a Belgian antique dealer. After an attempt was made to sell the codex in both New York and Paris, it was acquired by the Carl Gustav Jung Institute in Zurich in 1951, through the mediation of Gilles Quispel. There it was intended as a birthday present to the famous psychologist; for this reason, this codex is typically known as the Jung Codex, being Codex I in the collection.
Jung's death in 1961 caused a quarrel over the ownership of the Jung Codex, with the result that the pages were not given to the Coptic Musuem in Cairo until 1975, after a first edition of the text had been published. Thus the papyri were finally brought together in Cairo: of the 1945 find, eleven complete books and fragments of two others, 'amounting to well over 1000 written pages' (Markschies, Gnosis: An Introduction, 49) are preserved there.