The Pyramid Texts are the oldest known large corpus of ancient Egyptian religious writings.
They were inscribed inside royal pyramids during Egypt’s Old Kingdom, beginning in the pyramid of Pharaoh Unas at Saqqara. The texts contain spells intended to protect the dead king and help him join the gods in the afterlife.
The Pyramid Texts are not a single narrative book. They are a collection of individual utterances, hymns, rituals, and magical formulas. Later funerary traditions adapted some of their ideas for nonroyal people.
A common mix-up is placing the Pyramid Texts after the Book of the Dead. In fact, the Pyramid Texts are much earlier; the Coffin Texts developed later in the Middle Kingdom, while the Book of the Dead became especially prominent during the New Kingdom.