Ancient Egypt was a civilization of ancient North Africa along the lower reaches of the Nile which existed from 3100 BC to 30 BC. Upper Egypt and Lower Egypt united under Pharaoh Narmer, and Egypt was ruled by a series of dynasties grouped into three kingdoms: the Old Kingdom, Middle Kingdom, and the New Kingdom. The civilization developed along the fertile Nile River, where controlled irrigation of the fertile valley produced surplus crops, allowing for a more dense population and social development and culture. The Pharaohs of Egypt were able to develop the hieroglyphics writing system, organize collective construction and agricultural projects, trade with surrounding regions, and create a military which could assert Egyptian dominance. A bureaucracy of elite scribes, religious leaders, and administrators developed under the Pharaoh's rule, and Egypt's strong Kemetic religious faith, its able bureaucracy, and its adaptation to several rules allowed for the kingdom to retain a static culture for 3,000 years. Egypt reached the pinnacle of its power under the New Kingdom, which ruled over much of Nubia and a sizable portion of the Levant, after which it entered a period of slow decline. Egypt frequently came under foreign rule, including the Hyksos, the Libyans, the Nubians, the Assyrians, the Achaemenid Persians, and the Macedonians, the last of whom established the Hellenistic Ptolemaic Kingdom, which existed until 30 BC, when it was annexed by the Roman Republic as the province of "Aegyptus".
Advertisement