The decline of the Ancient Egyptian Empire happened gradually after its peak of power during the New Kingdom Period (1550-1069 BC). Throughout the period from the end of the 11th century BC until the 4th century BC, different foreign powers and native dynasties competed for control over the areas that the Ancient Egyptian Empire had controlled, displacing each other in turn and dividing the Nile Valley. Twice during the 6th and 4th centuries BC, the Achaemenid Persian Empire conquered Egypt before being displaced finally by the Greek led by Alexander the Great in 332 BC.
The arrival of Alexander opened a new era in Egyptian history. Even though Alexander and his army were Greek, he was regarded by the Egyptians as a liberator, freeing them from Persian control. Alexander accepted the Egyptian religion, associating the Egyptian gods with the gods of the Greek pantheon, and the Oracle of Amun in Siwa Oasis declared Alexander the right ruler of Egypt, destined to rule the world. By 334 BC, Alexander had left Egypt for good, marching east to continue his fight against the Persian Empire, but the impact that he had on Egypt during this short time was indelible. The capital that he founded and named after himself, Alexandria, became a center for learning and culture that contributed to preservation of ancient knowledge and the spread of Hellenism. The Ptolemaic Dynasty, established by one of his generals after Alexander’s death, would rule Egypt for three hundred years and the influence of Hellenism influenced the area and its people for much longer.
The Ptolemies and the Greek aristocracy that settled in Egypt under their rule did not remain as popular as Alexander had been with the Egyptians. Later members of the Ptolemy line fought against frequent uprisings, importing soldiers from Greece and from Jewish communities in Palestine to help them rule. These intermittent rebellions continued under the romans, who arrived under the command of Julius Caesar in 32 BC. In 30 BC under Emperor Augustus, Egypt became a province of the Roman Empire and it largely remained part of the Roman Empire until the 7th century AD even as Rome fell and the Roman capital was moved to Constantinople (modern Istanbul). A significant cultural shift took place in Egypt during this time as the the influence of Hellenism weakened the grip of Ancient Egyptian culture and religion on the Egyptians. Came to Egypt during the first century AD and spread quickly. During the 4th century AD, when the Roman Empire split in two and Christianity was finally recognized by Constantine, the Emperor of the Eastern Roman Empire (today called the Byzantine Empire), Christianity had become the dominant religion in Egypt.