In 332 BC, Alexander the Great, King of Macedon, invaded the Achaemenid satrapy of Egypt. As a consequence, he founded a new Greek city, Alexandria, to be the new capital. The wealth of Egypt could now be harnessed for Alexander's conquest of the rest of the Persian Empire. However, following Alexander's death in Babylon in 323 BC, a succession crisis erupted among his generals. Initially, Perdiccas ruled the empire as regent for Alexander's half-brother Arrhidaeus. Perdiccas appointed Ptolemy, one of Alexander’s closest companions, to be satrap of Egypt. Ptolemy ruled Egypt from 323 BC, nominally in the name of the joint kings Philip III and Alexander IV. However, as Alexander the Great's empire disintegrated, Ptolemy soon established himself as ruler in his own right. Ptolemy successfully defended Egypt against an invasion by Perdiccas in 321 BC, and consolidated his position in Egypt and the surrounding areas during the Wars of the Diadochi (322–301 BC). In 305 BC, Ptolemy took the title of King. As Ptolemy I Soter ("Saviour"), he founded the Ptolemaic dynasty that was to rule Egypt for nearly 300 years.