Apep, also spelled Apepi, Aapep, or Apophis, was the ancient Egyptian deity who embodied darkness and disorder, and was thus the opponent of light and Ma'at (order/truth). Ra was the bringer of light and hence the biggest opposer of Apep.
Set spearing the snake Apep (Egyptian Museum, Cairo)
The sun god Ra, in the form of Great Cat, slays the snake Apep
Apep below the barque of Ra with seven knives, Book of the Dead of Amenemsaouf, 21st Dynasty, Louvre Museum, Paris
The hieroglyph for Apep's name showing a serpent stabbed with five knives, Temple of Edfu, Ptolemaic period
Ancient Egyptian deities are the gods and goddesses worshipped in ancient Egypt. The beliefs and rituals surrounding these gods formed the core of ancient Egyptian religion, which emerged sometime in prehistory. Deities represented natural forces and phenomena, and the Egyptians supported and appeased them through offerings and rituals so that these forces would continue to function according to maat, or divine order. After the founding of the Egyptian state around 3100 BC, the authority to perform these tasks was controlled by the pharaoh, who claimed to be the gods' representative and managed the temples where the rituals were carried out.
The gods Osiris, Anubis, and Horus in the Tomb of Horemheb (KV57) in the Valley of the Kings
Narmer, a Predynastic ruler, accompanied by men carrying the standards of various local gods
Statue of the baboon god Hedj-Wer, inscribed with the name of king Narmer
Isis, a mother goddess and a patroness of kingship, holds Pharaoh Seti I in her lap.