Archaeological evidence suggests that Egypt was inhabited by hunters over 250,000 years ago when the region was a green grassland. The Palaeolithic period around 25,000BC brought climatic changes which turned Egypt into a desert. The inhabitants survived by hunting and fishing and through a primitive form of cultivation. Desertification of Egypt was halted by rains which allowed communities of cultivators to settle in Middle Egypt and the Nile Delta. These farmers grew wheat, flax and wove linen fabrics in addition to tending flocks. The first indigenous civilizations in Egypt have been identified in the south of the country through archaeological excavations. The Badarian culture is the earliest known developed Egyptian civilization based on farming, hunting and mining. Badarians produced fine pottery and carved objects as well as acquiring turquoise and wood through trading. The Naqada lived in larger settlements about 4,000BC and produced decorated pottery and figurines made from clay and ivory which indicate they were a war-like people. Naqada artefacts from 3,300BC show further development both in terms of culture and technology. Evidence of irrigation systems and more advanced burial sites, as well as the use of alien materials like lapis lazuli, indicate a cultural diversity and the development of external trading. Throughout most of its pre-dynastic history Egypt encompassed a multiplicity of settlements which gradually became small tribal kingdoms. These kingdoms evolved into two loosely confederated states: one encompassed the Nile valley up to the Delta (with the Naqada dominating) with Hierakonpolis as capital, represented by the deities Seth and White Crown; the other encompassed the Delta, with Buto as its capital and represented by the deities Horus and Red Crown. The two kingdoms vied for power over all the land of Egypt. This struggle led to the victory of the south and the unification of the Two Lands in 3100BC under the command of Menes who is also known as Narmer. This was the beginning of the dynastic period of the Pharaohs.
This period is shrouded in mythology. Little is known of Menes and his descendants outside of their divine ancestry and that they developed a complex social system, patronized the arts and constructed temples and many public buildings. The foundation of Memphis, the world's first imperial city, is attributed to Menes. From Memphis the third and fifth kings of the First Dynasty which extended from 3100 to 2890BC set out to conquer the Sinai. During the First Dynasty culture became increasingly refined. The royal burial grounds at Saqqara and Abydos became sites of highly developed mastabas. The Second Dynasty lasting from 2980 to 2686BC was characterized by regional disputes and a decentralization of Pharaonic authority, a process which was only temporarily halted by the Pharaoh Raneb, also called Hotepsekhemwy. These regional contentions were very likely the outcome of the unresolved conflict between the two deities Horus in the south and Seth in the Delta. Theistic rivalry seems to have been resolved by Khasekhem, the last Pharaoh of the Second Dynasty.
Pharaonic burial practices continued to develop during the Third Dynasty, lasting from 2686-2613BC, which marked the beginnings of the Old Kingdom. The first of Egypt's pyramids were constructed during the 27th century BC. The Step Pyramid of Saqqara built for King Zoser by his chief architect Imhotep, who later generations deified, is considered by many to be the first pyramid ever constructed in Egypt. Prior to this, most royal tombs were constructed of sun-dried bricks. Zoser's gargantuan step pyramid attested to the pharaoh's power and established the pyramid as the pre-eminent Pharaonic burial structure. During Zoser's rule the Sun God Ra attained a supra-eminent place over all other Egyptian deities. The Fourth Dynasty (2613-2494BC) was characterized by expansionism and pyramid construction. King Sneferu constructed the Red Pyramid at Dahshur near Saqqara and the Pyramid of Meidum in Al-Fayoum. He also sent military expeditions as far as Libya and Nubia. During his reign trading along the Nile flourished. Sneferu's descendants, Cheops (Khufu), Chephren (Khafre) and Mycerinus (Menkaure) were the last three kings of the Fourth Dynasty. These three pharaohs built the pyramids of Giza. Egypt under Cheops became the first state in the history of the world to be governed according to an organized system. The Fourth Dynasty also extended trade relations with the Near East and mined and smelted copper in Nubia. The Fifth Dynasty (2490-2330BC) was marked by a relative decline in Pharaonic power and wealth, evidenced by the smaller pyramids of Abu Sir built during this period. The pharaohs ceased to be absolute monarchs and began to share power with the aristocracy and high officials. As the independence of the nobility increased, their tombs became larger and were built at increasing distances from the pharaohs. Worship of the sun god Ra also spread during the Fifth Dynasty. It was during the reign of Unas that religious texts were placed in the pyramids bearing descriptions of the afterworld which were later gathered into the Book of the Dead. Decentralization of Pharaonic authority increased during the Sixth Dynasty (2330-2170BC) as small provincial principalities emerged to challenge Pharaonic power. The Sixth Dynasty kings were forced to send expeditions as far as Nubia, Libya and Palestine to put down the separatists, but these campaigns served to further erode the central authority. By the reign of the last Sixth Dynasty Pharaoh Pepi II, the Old Kingdom had become a spent force.