Al-Maqrizi notes that Khufu was named "Saurid", "Salhuk" and/or "Sarjak" by the biblical Amalekites. Then he writes that Khufu built the pyramids after repeated nightmares in which the earth turned upside-down, the stars fell down and people were screaming in terror. Another nightmare showed the stars falling down from heaven and kidnapping humans, then putting them beneath two large mountains. King Khufu then received a warning from his prophets about a devastating deluge that would come and destroy Egypt. To protect his treasures and books of wisdom, Khufu built the three pyramids of Giza.