Traditional Berber religion
The traditional Berber religion is the ancient and native set of beliefs and deities adhered to by the Berbers (Amazigh autochthones) of North Africa. Many ancient Amazigh beliefs were developed locally, whereas others were influenced over time through contact with other ancient Egyptian religion, or borrowed during antiquity from the Punic religion, Judaism, Iberian mythology, and the Hellenistic religion. The most recent influence came from Islam and religion in pre-Islamic Arabia during the medieval period. Some of the ancient Amazigh beliefs still exist today subtly within the Amazigh popular culture and tradition. Syncretic influences from the  traditional Amazigh religion can also be found in certain other faiths. Funerary practices. Archaeological research on prehistoric tombs in the Maghreb shows that the bodies of the dead were painted with ochre. While this practice was known to the Iberomaurusians, this culture seems to have been primarily a Capsian industry. The dead were also sometimes buried with shells of ostrich eggs, jewelry, and weapons. Bodies were usually buried in a fetal position. Unlike the majority of mainland Berbers, the Guanches mummified the dead. Additionally, in 1958 University of Rome Professor Fabrizio Mori (1925-2010) discovered a Libyan mummy around 5,500  years old — roughly a thousand years older than any known Ancient Egyptian mummy. Cult of the dead. Herodotus in "The Histories" stated that the cult of the dead was one of the distinguishing characteristics of Libya in antiquity. Pomponius Mela reported that the Augilae (Modern Awjila in Libya) considered the spirits of their ancestors to be gods. They swore by them and consulted them. After making requests, they slept in their tombs to await responses in dreams. Herodotus (484 BC–ca.425 BC) noted the same practice among the Nasamones, who inhabited the deserts around Siwa and Augila. He wrote: [..]They  swear by the men among themselves who are reported to have been the most righteous and brave, by these, I say, laying hands upon their tombs; and they divine by visiting the sepulchral mounds of their ancestors and lying down to sleep upon them after having prayed; and whatsoever thing the man sees in his dream, this he accepts.The Berbers worshiped their kings, too. The tombs of the Numidian kings are among the most notable monuments left by the Classical Berbers. The veneration (not worship) of saints which exists among the modern Berbers in the form of Maraboutism—which  is widespread in northwest Africa—may or may not contain traces of prior beliefs or customs concerning the dead. Ancient Berber tombs. The tombs of the early people and their ancestors indicate that the Berbers and their forebears (the Numidians and Mauretanians) believed in an afterlife. The prehistoric people of northwest Africa buried bodies in little holes. When they realized that bodies buried in unsecured holes were dug up by wild animals, they began to bury them in deeper ones. Later, they buried the dead in caves, tumuli, tombs in rocks, mounds, and other types of tombs. These tombs evolved  from primitive structures to much more elaborate ones, such as the pyramidal tombs spread throughout Northern Africa. The honor of being buried in such a tomb appears to have been reserved for those who were most important to their communities. These pyramid tombs have attracted the attention of some scholars, such as Mohamed Chafik who wrote a book discussing the history of several of the tombs that have survived into modern times. He tried to relate the pyramidal Berber tombs with the great Egyptian pyramids on the basis of the etymological and historical data. The best known Berber pyramids are  the 19-meter pre-Roman Numidian pyramid of the Medracen and the 30-meter ancient Mauretanian pyramid. The Numidian pyramid in Tipaza is also known as Kbour-er-Roumia or "Tomb of Juba and Sypax", mistranslated by the French colonists as "Tomb of the Christian Woman". The Tomb holds the graves of King Juba II and Queen Cleopatra Selene II, sovereigns of Mauretania. Megalithic culture. Augustine of Hippo mentioned that the polytheistic Africans worshipped the rocks. Apuleius stated as well that rocks were worshipped in the second century. The megalithic culture may have been part of a cult of the  dead or of star-worship. The monument of Msoura is the best-known megalithic monument in northwest Africa. It is composed of a circle of megaliths surrounding a tumulus. The highest megalith is longer than 5 meters. According to legend, it is the sepulchre of the mythical Berber king Antaeus. Another megalithic monument was discovered in 1926 to the south of Casablanca. The monument was engraved with funerary inscriptions in the Berber script known as Tifinagh. Herodotus mentioned that the ancient Berbers worshipped the moon and sun and sacrificed to them. He reported: Tullius Cicero (105-43 BC) also reported  the same cult in "On the Republic (Scipio's Dream)": There were some Latin inscriptions found in Northwest Africa dedicated to the sun-god. An example is the inscription found in Souk Ahras (the birthplace of Augustine; Thagaste in Algeria) written "Solo Deo Invicto". Samuel the Confessor appears to have suffered from the sun-worshiping Berbers who tried unsuccessfully to force him to worship the sun. The Berber pantheon also contained multiple gods, known as the Dii Mauri, represented on reliefs and also the subject of dedications. During the Roman period, Saturn was the focus of an important cult, subsuming  that of Baal Hammon, a deity of Punic origin. Libyan-Egyptian beliefs. The Ancient Egyptians were the neighbors of the Berbers. Therefore, it is sometimes supposed that some deities were originally worshipped by the Ancient Egyptians and the Ancient Libyans as well. The Egyptian-Libyans gods and goddesses can be distinguished according to their origin. Egyptian deities. The Eastern ancient Berbers worshipped Isis and Set. That was reported by Herodotus when saying: Cow's flesh, however, none of these [Libyan] tribes ever taste, but abstain from it for the same reason as the Egyptians, neither do they any of them  breed swine. Even at Cyrene, the women think it wrong to eat the flesh of the cow, honoring in this Isis, the Egyptian goddess, whom they worship both with fasts and festivals. The Barcaean women abstain, not from cow's flesh only, but also from the flesh of swine. Those Libyans supposedly did not eat the flesh of swine, because it was associated with "Set", while they did not eat the cow's flesh, because it was associated with Isis. Osiris was among the Egyptian deities who were venerated in Libya. However, Dr. Budge (in addition to a few other  scholars) believed that Osiris was originally a Libyan god saying of him that "Everything which the texts of all periods recorded concerning him goes to show that he was an indigenous god of Northeast Africa (modern day Libya), and that his home and origin were possibly Libyan." Libyan deities. The Egyptians considered some Egyptian deities to have had a Libyan origin, such as Neith who has been considered, by Egyptians, to have emigrated from Libya to establish her temple at Sais in the Nile Delta. Some legends tell that Athena/Neith was born around Lake Tritons (in modern Libya). It  is also notable that some Egyptian deities were depicted with Libyans (ancient Libyan) characters. The goddess Ament was thus portrayed with two feathers, which were the normal ornaments of the Ancient Libyans as they were drawn by the Ancient Egyptians. Ammon as a common deity. The most remarkable common god of the Berbers and the Egyptians was Ammon. This god is hard to attribute to only one pantheon. Although most modern sources ignore the existence of Ammon in Berber mythology, he was maybe the greatest ancient Berber god. He was honored by the Ancient Greeks in Cyrenaica, and was united  with the Phoenician god Baal due to Libyan influence. Early depictions of rams (related possibly to an early form of the cult of this deity) across North Africa have been dated to between 9600 BC and 7500 BC. The most famous temple of Ammon in Ancient Libya was the augural temple at Siwa in Egypt, an oasis still inhabited by Berbers. Phoenician-Berber beliefs. The Phoenicians were originally a Semitic people who inhabited the coast of modern Lebanon, and later also of Tunisia. The Phoenicians of Lebanon were seafarers and they founded Carthage in 814 BC. They later gave birth  to the so-called "Punic culture", which had its roots in the Berber and Phoenician cultures. Some scholars distinguish the relationships between the Phoenicians and the Berbers in two phases: Before the Battle of Himera (480 BC). When Phoenicians settled in Northwest Africa, they stayed in the coastal regions to avoid wars with the Berbers. They maintained their deities which they brought from their homeland. Therefore, early Carthaginians had two important Phoenician deities, "Baal" and "Astarte". After the Battle of Himera. Carthage began to ally with the Berber tribes after the Battle of Himera, in which the Carthaginians were defeated  by the Greeks. In addition to political changes, the Carthaginians imported some of the Berber deities. Baal was the primary god worshipped in Carthage. Depictions of this deity are found in several sites across northwest Africa. The goddess Astarte was replaced by a native goddess, "Tanit", which is thought to be of Berber origin. The name itself, "Tanit", has a Berber linguistic structure. Feminine names begin and end with "t" in the Berber languages. Some scholars believe that the Egyptian goddess Neith was related to the Libyan goddess Tanit (Ta-neith). There are also Massyle and Phoenician names that apparently  contain roots from the god "Baal", such as "Adherbal" and "Hannibal". Greek-Libyan beliefs. The ancient Greeks established colonies in Cyrenaica. The Greeks influenced the eastern Libya pantheon, but they were also influenced by Libyan culture and beliefs. Generally, the Libyan-Greek relationships can be divided into two different periods. In the first period, the Greeks had peaceful relationships with the Libyans. Later, there were wars between them. These social relationships were mirrored in their beliefs. Before the Battle of Irassa (570 BC). The first notable appearance of Libyan influence on the Cyrenaican-Greek beliefs is the name "Cyrenaica" itself . This name was originally the name of a legendary (mythic) Berber woman warrior who was known as "Cyre". Cyre was, according to the legend, a courageous lion-hunting woman. She gave her name to the city "Cyrenaica". The emigrating Greeks made her their protector besides their Greek god Apollo. The Greeks of Cyrenaica seemed also to have adopted some Berber customs and intermarried with the Berber women. Herodotus (Book IV 120) reported that the Libyans taught the Greeks how to yoke four horses to a chariot (the Romans used these Libyan chariots later, after they were taught to do so  by the Greeks). The Cyrenaican Greeks built temples for the Libyan god Ammon instead of their original god Zeus. They later identified their supreme god Zeus with the Libyan Ammon. Some of them continued worshipping Ammon himself. Ammon's cult was so widespread among the Greeks that even Alexander the Great decided to be declared as the son of Zeus in the Siwan temple by the Libyan priests of Ammon. The ancient historians mentioned that some Greek deities were of Libyan origin. The daughter of Zeus Athena was considered by some ancient historians, like Herodotus, to have been of Libyan  origin. Those ancient historians stated that she was originally honored by the Libya around Lake Tritonis where she had been born from the god Poseidon and Lake Tritonis, according to the Libyan legend. Herodotus wrote that the Aegis and the clothes of Athena are typical for Libyan woman. Herodotus also stated that Poseidon (an important Greek sea god) was adopted from the Libyans by the Greeks. He emphasized that no other people worshipped Poseidon from early times apart from the Libyans who spread his cult: [..]these I think received their naming from the Pelasgians, except Poseidon; but about this god  the Hellenes learnt from the Libyans, for no people except the Libyans have had the name of Poseidon from the first and have paid honour to this god always. Some other Greek deities were related to Libya. The goddess Lamia was believed to have originated in Libya, like Medusa and the Gorgons. The Greeks seem also to have met the god Triton in Libya. The modern day Berbers may have believed that the Hesperides was situated in modern Morocco. Some scholars situate it in Benghazi of Irassa where Antaeus lived, according to some myths. The Hesperides were believed to be  the daughters of Atlas a god that is associated with the Atlas mountains by Herodotus. The Atlas mountain was worshipped by the Berbers and the Canary Islands represented to many the daughters of Atlas. But that could be wrong since all historical evidences states that modern day Benghazi was originally named Euesperides which gave rise to the mythological associations of the garden of the Hesperides. Most gigantic creatures existed in northeastern Africa, including Modern Libya, e.g., the giant snakes, the Hydra and the Barbary Lions on the coast of Tripoli. After the Battle of Irassa. The Greeks and the Libyans  began to break their harmony in the period of Battus II of Cyrene. Battus II began secretly to invite other Greek groups to Libya, Tunisia and East Algeria. The Libyans and Massyle considered that as a danger that had to be stopped. The Berbers began to fight against the Greeks, sometimes in alliance with the Egyptians and other times with the Carthaginians. Nevertheless, the Greeks were the victors. Some historians believe that the myth of Antaeus was a reflection of those wars between the Libyans and Greeks. Roman-Berber beliefs. The Romans allied firstly with the Massyle against Carthage. They  defeated Carthage in 146 BC. But later, they also annexed Massyle to the Roman Empire. The Imperial Period. According to Pliny the Elder, the Libyans honored the war goddess Ifri or "Africa", who was considered to be the protector of her worshipers (and seemed to have been an influential goddess in North Africa) and depicted her on the Berber coins. This goddess was represented in diverse ways on Numidian coins from the first century BC. When the Romans conquered Northwest Africa, she appeared in sculpture and on the coins of the Roman states in North Africa. The Roman pantheon seems  to have been adopted generally, although the cult of Saturn, as mentioned above, was perhaps the most important. A new god appears in later texts, identified with tribes such as the Austuriani outside the Roman frontiers of Libya. Gurzil was a war god who identified with the son of Ammon. He was taken by the Berbers to their battles against the Byzantines. Corippus mentioned that the chiefs of the Laguata took their god "Gurzil" into battle against the Byzantines and Arabs. It is very likely that the sanctuary of Gurzil was located in Ghirza, in Libya, where remarkable reliefs show  a noble Libyan receiving tribute while seated on a curule chair.