Astyages, king of Media, was the dominant ruler in the Middle East when he moved to crush a rebellion in Persia, led by his grandson Cyrus. Cyrus triumphed at the Battle of Pasargadae, going on to capture the Median capital Ecbatana (550 BCE). Now in control of a substantial empire, he moved to suppress an opportunistic revolt by the Lydians. After being checked at Pteria (547 BCE), he triumphed at Sardis (546 BCE). After conquering Babylon (539 BCE), he turned his attention eastwards: he would die fighting the Massagetae (530 BCE). His successor, Cambysses II, completed the conquest of Egypt after victory at Pelusium (525 BCE). Darius the Great took the empire to its apogee extending its borders to the Indus Valley in the east, and Cyrene and Thrace in the west. But he would be repulsed by the Greek city-states, who defeated his armies at Marathon (490 BCE).