<P> In 459 BC, Athens took advantage of a war between its neighbors Megara and Corinth, both Spartan allies, to conclude an alliance with Megara, giving the Athenians a critical foothold on the Isthmus of Corinth . A fifteen - year conflict, commonly known as the First Peloponnesian War, ensued, in which Athens fought intermittently against Sparta, Corinth, Aegina, and a number of other states . For a time during this conflict, Athens controlled not only Megara but also Boeotia; at its end, however, in the face of a massive Spartan invasion of Attica, the Athenians ceded the lands they had won on the Greek mainland, and Athens and Sparta recognized each other's right to control their respective alliance systems . The war was officially ended by the Thirty Years' Peace, signed in the winter of 446 / 5 BC . </P> <P> The Thirty Years' Peace was first tested in 440 BC, when Athens' powerful ally Samos rebelled from its alliance with Athens . The rebels quickly secured the support of a Persian satrap, and Athens found itself facing the prospect of revolts throughout the empire . The Spartans, whose intervention would have been the trigger for a massive war to determine the fate of the empire, called a congress of their allies to discuss the possibility of war with Athens . Sparta's powerful ally Corinth was notably opposed to intervention, and the congress voted against war with Athens . The Athenians crushed the revolt, and peace was maintained . </P> <P> The more immediate events that led to war involved Athens and Corinth . After suffering a defeat at the hands of their colony of Corcyra, a sea power that was not allied to either Sparta or Athens, Corinth began to build an allied naval force . Alarmed, Corcyra sought an alliance with Athens, which after debate and input from both Corcyra and Corinth, decided to swear a defensive alliance with Corcyra . At the Battle of Sybota, a small contingent of Athenian ships played a critical role in preventing a Corinthian fleet from capturing Corcyra . In order to uphold the Thirty Years' Peace, however, the Athenians were instructed not to intervene in the battle unless it was clear that Corinth was going to press onward to invade Corcyra . However, the Athenian warships participated in the battle nevertheless, and the arrival of additional Athenian warships was enough to dissuade the Corinthians from exploiting their victory, thus sparing much of the routed Corcyraean and Athenian fleet . </P> <P> Following this, Athens instructed Potidaea (Chalcidice peninsula), a tributary ally of Athens but a colony of Corinth, to tear down its walls, send hostages to Athens, dismiss the Corinthian magistrates from office, and refuse the magistrates that the city would send in the future . The Corinthians, outraged by these actions, encouraged Potidaea to revolt and assured them that they would ally with them should they revolt from Athens . Meanwhile, the Corinthians were unofficially aiding Potidaea by sneaking contingents of men into the besieged city to help defend it . This was a direct violation of the Thirty Years' Peace, which had (among other things) stipulated that the Delian League and the Peloponnesian League would respect each other's autonomy and internal affairs . </P>

How did sparta win the peloponnesian war over athens