Every evening, as the sun dipped below the western horizon, the ancient Egyptians knew the real work began. The god Ra boarded his solar barque and sailed into the underworld, where a serpent of pure chaos waited to swallow the light. That serpent was Apep (also called Apophis, from the Greek Ἄποφις), and the battle that followed was not a metaphor. It was the mechanism that kept the cosmos from unraveling.
The struggle between Apep and Ra illustrates the cosmic struggle as a daily, physical war between order (maat) and chaos (isfet). Ra represents the sun, life, and the established order of creation. Apep represents the primordial chaos that existed before creation and constantly threatens to return. Their nightly battle ensures the sun rises again, and with it, the possibility of life.
Where the Myth First Appears

The earliest known references to Apep appear in the Pyramid Texts (c. 2400 BCE), the funerary inscriptions carved into the walls of the pyramids at Saqqara. Utterance 273 describes the deceased king as one who “has come against the serpent, who has come against Apep.” The serpent is already the enemy of the sun god, and the king, by joining Ra, helps defeat it.
By the Coffin Texts (c. 2100 BCE), the conflict is fully developed. Spell 160 describes Ra’s journey through the underworld and the serpent’s attempt to block the barque. The Book of the Dead (c. 1550 BCE) includes multiple spells (e.g., Spell 39, Spell 108) that the deceased recites to repel Apep and ensure safe passage through the Duat. The most detailed ritual text is the Book of Overthrowing Apep, preserved in the Papyrus Bremner-Rhind (c. 310 BCE), which contains spells, instructions for making wax effigies, and the exact words to speak while burning the serpent.
The conflict is not a single event. It repeats every night, and every dawn is proof that Ra won again. That cyclical nature is what made the myth so powerful: order is never permanently secured.
What Apep and Ra Actually Represent

Apep is not a god. He is the embodiment of isfet — the Egyptian concept of chaos, disorder, injustice, and evil. In the Coffin Texts, he is called “the Great Serpent,” “the Evil One,” and “the Enemy of Ra.” He dwells in the Duat, the underworld, specifically in a region called the Bakhu (the eastern mountain) or the Island of Fire, depending on the text. He has no temples, no priests, no offerings. He is the one thing Egyptians did not worship.
Ra is the embodiment of maat — truth, balance, cosmic order. As the sun god, he is the source of light, life, and time itself. But Ra is not invincible. He ages, he grows weary, and he needs help. The nightly battle is a collective effort: other gods like Set (who stands on the prow of the barque and spears the serpent), Bastet (who cuts off Apep’s head with a knife), and Horus (who guards the boat) all assist. Even the deceased, if they have lived a just life, can join the crew.
The cosmic struggle is therefore not a simple good-versus-evil duel. It is a maintenance of fragile order against a chaos that never dies. Apep is not defeated permanently. He is repelled, bound, cut up, burned — but he always reforms. The battle must be fought again the next night. That is the price of a sunrise.
How the Battle Was Fought (and Helped)
The Egyptians did not leave the fight to the gods. Priests performed daily and annual rituals to “repel Apep,” effectively sending magical reinforcements to Ra’s barque. The Book of Overthrowing Apep gives the procedure in exacting detail.
A wax figure of Apep was made, inscribed with his name in green ink (the color of the serpent). The priest then spat on it, trampled it with the left foot, struck it with a spear, and finally threw it into a fire. The ashes were mixed with excrement and burned again. The same text includes instructions for drawing Apep on a piece of new papyrus, cutting it up, and burning it. These actions were not symbolic. They were believed to physically weaken the serpent in the underworld.
The most public ritual was the annual Festival of Overthrowing Apep, held during the fifth hour of the night in the temple of Karnak. The pharaoh himself sometimes participated, acting as the earthly counterpart of Ra. A text from the reign of Ramesses III (c. 1186–1155 BCE) records that the king “overthrew Apep in the great temple of Amun”, a political act that reaffirmed the king’s role as guarantor of maat.
For ordinary Egyptians, the battle was visible in the sky. A solar eclipse was interpreted as Apep swallowing the sun temporarily. Thunderstorms and earthquakes were signs of the serpent thrashing. Spells from the Book of the Dead were buried with the dead so they could help Ra from the afterlife. And if you have been pronouncing it uh-POH-fis, you are in good company: the Greek form Apophis is how most classical authors knew him.
How This Myth Compares to Other Cosmic Struggles
The Apep-Ra conflict belongs to a family of creation myths where a hero god defeats a chaos monster. The closest parallel is Marduk vs. Tiamat in the Babylonian Enuma Elish (c. 1750 BCE). Tiamat, the saltwater serpent, is split in two to form the heavens and the earth. But there is a crucial difference: Tiamat is killed permanently. Apep is not. The Egyptian myth is cyclical, not eschatological. The world does not end when Apep wins; it simply does not begin again.
In Norse mythology, the serpent Jörmungandr encircles the world and will fight Thor at Ragnarök, a final battle. Again, one-time. In Hebrew scripture, Leviathan is a chaos serpent that God subdues at creation (Psalm 74, Isaiah 27). It is not a daily threat.
The Egyptian view is more pessimistic: chaos is not a one-time enemy. It is the default state. Order must be recreated every single day. That is why the sun god is not a triumphant warrior but a tired old king who needs a crew. The cosmic struggle is not a victory lap. It is a grind.
What People Get Wrong About Apep
The most common mistake is calling Apep a “god of chaos.” He is not a god. He has no cult, no mythology beyond being the enemy, and no positive role in creation. The Egyptians distinguished between Set, who is a god of chaos but also a necessary force (he stands on the barque and fights Apep), and Apep, who is pure negation. Set is part of the pantheon; Apep is outside it.
Another misconception is that Ra fights alone. The texts consistently show a crew. The Amduat (the “Book of What Is in the Duat,” c. 1500 BCE) describes the twelfth hour of the night, where Ra is reborn as a scarab beetle (Khepri) after the serpent is defeated. The crew includes the gods Sia (perception), Hu (authoritative utterance), and Heh (infinity). The battle is a collective act of creation.
A third error: that Apep is a dragon or a multi-headed beast. He is almost always a serpent, sometimes a coiled snake, sometimes a giant worm. In the Book of Gates, he is depicted as a serpent with many coils, bound by chains held by gods. He is not a dragon in the European sense.
FAQ
Is Apep a god?
No. He is a demonic serpent, the embodiment of chaos (isfet). He has no temples, no worshippers, and no positive role in Egyptian religion.
Why does Ra need help to defeat Apep?
Ra is old and weary from his daily journey. The gods Set, Bastet, Horus, and the justified dead all assist him. The battle is a collective effort to maintain cosmic order.
What happens if Apep wins?
If Apep swallows the sun, the sun will not rise. The world would fall into eternal darkness and chaos. That is why the ritual repelling of Apep was so urgent.
How did ordinary Egyptians help in the battle?
They performed spells from the Book of the Dead, participated in temple rituals, and lived justly to maintain maat on earth. A just life made one eligible to join Ra’s crew after death.
The Nightly War Continues
The battle between Apep and Ra is not a story from a dead religion. It is a model for how the Egyptians understood existence itself: order is never given, it is fought for. Every dawn is a victory. Every dusk is a preparation. The serpent waits, and the sun must sail. That is the cosmic struggle, and it has no end.
For more on how ancient cultures framed the conflict between order and chaos, see our guide to mythology. You may also want to read about the Egyptian concept of maat and the role of Set in the pantheon.
