In 499 BC, Athens lent support to a revolt in Miletus, which resulted in the sacking of Sardis. This led to an Achaemenid campaign against mainland Greece known as the Greco-Persian Wars, which lasted the first half of the 5th century BC, and is known as one of the most important wars in European history. In the First Persian invasion of Greece, the Persian general Mardonius re-subjugated Thrace and made Macedon a full part of Persia. The war eventually turned out in defeat, however. Darius' successor Xerxes I launched the Second Persian invasion of Greece. At a crucial moment in the war, about half of mainland Greece was overrun by the Persians, including all territories to the north of the Isthmus of Corinth, however, this was also turned out in a Greek victory, following the battles of Plataea and Salamis, by which Persia lost its footholds in Europe, and eventually withdrew from it. During the Greco-Persian wars Persia gained major territorial advantages capture and razed Athens in 480 BC. However, after a string of Greek victories the Persians were forced to withdraw thus losing control of Macedonia, Thrace and Ionia. Fighting continued for several decades after the successful Greek repelling of the Second Invasion with numerous Greek city-states under the Athens' newly formed Delian League, which eventually ended with the peace of Callias in 449 BC, ending the Greco-Persian Wars. In 404 BC, following the death of Darius II, Egypt rebelled under Amyrtaeus. Later pharaohs successfully resisted Persian attempts to reconquer Egypt until 343 BC, when Egypt was reconquered by Artaxerxes III.