In 525 BC, Egypt was conquered by the Achaemenid Empire. Because of internal struggles for the Persian imperial succession, Egypt managed to regain independence in 404 BC. In 389 BC, Pharaoh Hakor negotiated a treaty with Athens and for three years (from 385 to 383 BC) managed to withstand Persian aggression.[11] However, following the conclusion of the Peace of Antalcidas in 387 BC between the Achaemenids and the Greek city-states, Egypt and Cyprus became the only obstacles to Persian hegemony in the Mediterranean.