The Theban hegemony lasted from the Theban victory over the Spartans at Leuctra in 371 BC to their defeat of a coalition of Peloponnesian armies at Mantinea in 362 BC, though Thebes sought to maintain its position until finally eclipsed by the rising power of Macedon in 346 BC. Externally, the way was paved for Theban ascendancy by the collapse of Athenian power in the Peloponnesian War (431–404 BC), through the weakening of the Spartans by their oliganthropia (demographic decline) and by the inconclusive Corinthian War (395–386 BC). Internally, the Thebans enjoyed two temporary military advantages: The leaders of the Theban oligarchy at the time, Epaminondas and Pelopidas, were fully committed to an aggressive foreign policy and could be relied on to win any battle and The same leaders had instituted tactical improvements in the Theban heavy infantry (e.g. longer spears, the use of a wedge-shaped formation of spearmen), which had yet to catch on among their rivals. The Thebans had traditionally enjoyed the hegemony of the Boeotian League, the oligarchical federation of Aeolic-speaking Greeks to the immediate north-west of Athenian-dominated Attica. Their brief rise to power outside the Boeotian Plain began in 373 when the Boeotians defeated and destroyed the town of Plataea, strategically important as the only Athenian ally in Boeotia. This was taken as a direct challenge by the previous hegemonic power, the Spartans, who gambled on restoring their waning ascendancy by a decisive defeat of the Thebans. At Leuctra, in Boeotia, the Thebans comprehensively defeated an invading Spartan army. Out of 700 Spartan citizen-soldiers present, 400 died at Leuctra. After this, the Thebans systematically dominated Greece. In the south, they invaded the Peloponnese to liberate the Messenians and Arcadians from Spartan overlordship and set up a pro-Theban Arcadian League to oversee Peloponnesian affairs. In the north, they invaded Thessaly, to crush the growing local power of Pherae and took the future Philip II of Macedon hostage, bringing him to Thebes. Pelopidas, however was killed at Cynoscephalae, in battle against troops from Pherae (though the battle was actually won by the Thebans). The Thebans overstretched themselves strategically and, in their efforts to maintain control of the north, their power in the south disintegrated. The Spartan king, Agesilaus II, scraped together an army from various Peloponnesian towns dissatisfied with Theban rule and managed to kill but not defeat Epaminondas in the Battle of Mantinea, but not to re-establish