The first Achaemenid conquest of Egypt took place in 525 BCE, leading to the foundation of the Twenty-seventh Dynasty of Egypt, also known as the "First Egyptian Satrapy" (Old Persian: Mudrāya[5]). Egypt thus became a satrapy of the Achaemenid Empire until 404 while still maintaining Egyptian royalty customs and positions.[6] The conquest was led by Cambyses II, who defeated the Egyptians at the Battle of Pelusium (525 BCE), and crowned himself pharaoh. Achaemenid rule was disestablished upon the rebellion and crowning of Amyrtaeus as Pharaoh. A second period of Achaemenid rule in Egypt occurred under the Thirty-first Dynasty of Egypt (343–332 BCE).