 In the late 7th century BC Theagenes established himself as tyrant of Megara by slaughtering the cattle of the rich to win over the poor.During the second Persian invasion of Greece (480–479 BC) Megara fought alongside the Spartans and Athenians at crucial battles such as Salamis and Plataea.Megara defected from the Spartan-dominated Peloponnesian League (c. 460 BC) to the Delian league due to border disputes with its neighbour Corinth; this defection was one of the causes of the First Peloponnesian War (460 – c. 445 BC).