Sasanian conquest of Egypt

Between 618 and 621 AD, the Sassanid Persian army defeated the East Roman (Byzantine) forces in Egypt and occupied the province. The fall of Alexandria, the capital of Roman Egypt, marked the first and most important stage in the Sassanid campaign to conquer this rich province, which eventually fell completely under Persian rule within a couple of years.

Background
The Persian shah, Khosrau II, had taken advantage of the internal turmoil of the East Roman Empire after the overthrow of Emperor Maurice by Phocas to attack the Roman provinces in the East. By 615, the Persians had driven the Romans out of northern Mesopotamia, Syria and Palestine. Determined to eradicate Roman rule in Asia, Khosrau turned his sight on Egypt, the East Roman Empire's granary.

Fall of Egypt
The Persian invasion of Egypt began either in 617 or 618, but little is known about the particulars of this campaign, since the province was practically cut off from the remaining Roman territories. The Persian army headed for Alexandria, where Nicetas, Heraclius' cousin and local governor, was unable to offer effective resistance. He and the Chalcedonian patriarch, John V, fled the city to Cyprus. According to the Khuzistan Chronicle, Alexandria was then betrayed to the Persians by a certain Peter in June 619.

After the fall of Alexandria, the Persians gradually extended their rule southwards along the Nile. Sporadic resistance required some mopping-up operations, but by 621, the province was securely in Persian hands.

Aftermath
Egypt would remain in Persian hands for 10 years, run by general Shahrbaraz from Alexandria. As the new Roman emperor, Heraclius, reversed the tide and defeated Khosrau, Shahrbaraz was ordered to evacuate the province, but refused. In the end, Heraclius, trying both to recover Egypt and to sow disunion amongst the Persians, offered to help Shahrbaraz seize the Persian throne for himself. An agreement was reached, and in the summer of 629, the Persian troops began leaving Egypt.