In Ancient Egypt, magic was tightly bound up with writing (although there must have been an extensive oral tradition which was never recorded and is therefore lost to us).
Most priests gained magical and medical knowledge by studying ancient scriptures. The lector-priests (high priests) were the most knowledgeable as they were the keepers of the sacred books. There was no clear demarcation line to have separated medicine and magic (and other great works), and the lector-priests worked according to quite strict guidelines as to what medical treatments and magical remedies were to be performed, or not, depending on interpretations, oracles, and what was written in the sacred books.
The Westcar Papyrus is an ancient Egyptian text containing five stories about magic and miracles performed by the lector-priests. In the text, each of these tales are told at the royal court of Pharaoh Khufu of the 4th dynasty (25th century BCE). The surviving material of the Westcar Papyrus has been dated to the 18-19th century BCE and is written in classical Middle Egyptian.
The first story of the Westcar Papyrus is told by Djedefre, son of Pharaoh Khufu, but only a few lines of the story remain. It seems to have been a text detailing a miracle performed by a lector-priest during the reign of the Pharaoh Djoser. It is believed that the lector-priest performing the miracle was Imhotep, the architect of Djoser’s Step Pyramid.
Then his majesty the King of Upper and Lower Egypt Khufu said “let an offering be made of a thousand loaves of bread, a hundred jars of beer, one ox and two balls of incense to the King of Upper and Lower Egypt Djoser, justified, and let there be given one cake, one jug of beer, a large portion of meat and one ball of incense to the chief lector-priest [Imhotep], as I have seen an example of his learning.”
One did as everything as his majesty had ordered.
~ Westcar Papyrus – 1st story
The name “Imhotep” may be familiar due to contemporary stories and films. However, the “real” Imhotep was truly a significant person. Egyptologists believe that he designed the Step Pyramid at Saqqara in Egypt in 2630–2611 BCE and may also have been responsible for the first known use of stone columns to support a building. He was also the High Priest to Re, the Sun God, at Heliopolis.
Some consider Imhotep one of the forefather’s of early medicine alongside Hippocrates. These claims are based on the legends that flourished in the millennia after his death. One of the first texts to reference Imhotep dates to the time of Amenhotep III (1391–1353 BCE), more than a thousand years after his death. It is a prayer and libation to Imhotep. The libations seem to have been done regularly and consistently for a thousand years, or more, and these are on papyri associated with statues of Imhotep up until the Late Period (c. 664–332 BCE).
There was a slow enhancement or evolution of the memory of Imhotep among intellectuals from his death onwards and it is strong that it appears Imhotep was venerated in the New Kingdom (c. 1550–1077 BCE) as demi-god. There was a “cult” of Imhotep linking him with the God Thoth. The first references to the healing abilities of Imhotep occur from the Thirtieth Dynasty (c. 380–343 BCE) onwards, some 2200 years after his death.
Magic, mathematics, literature and medicine go hand-in-hand in Ancient Egypt. Written hieroglyphics are a work of Heku, because mastery of the written word confers power on the object described. The extraordinary durability of hieroglyphics, Egyptian writing, though heavy, complicated, and challenging can be explained by the magical (Heku!) value of this writing.