In 462 BC, fighting broke out between members of the Delian League, led by Athens, and the Peloponnesian League, led by Sparta. A truce, the so-called Thirty Years' Peace, was initiated in 446 BC but lasted no longer than fifteen years.
Corcyra (modern Corfu), a colony of Corinth, was embroiled at this time in a conflict with its mother-city. Athens assisted Corcyra against Corinth, which was also an ally of Sparta. This led to the outbreak of the Peloponnesian War in 431 BC. The Athenian fleet, based in the Piraeus, dominated the naval engagements in the long struggle that followed.
Just as Athens relied on the Delian League, so Sparta found support in the member cities of the Peloponnesian League, which had superior troops on land. Soon Sparta had Athens under siege. Each spring between 431 and 421 BC, the Spartan army returned to Athens to burn down the fields around the city. The people of Athens and the surrounding countryside of Attica sought refuge behind the city walls, including the Long Walls, which connected the city to the port in the Piraeus. The siege of Athens left her inhabitants starved and menaced by plague.
In 415 BC, after an armistice lasting six years, the war spread to Sicily and southern Italy. In a failed expedition to Sicily, Athens lost a large portion of her fleet, giving Sparta the opportunity to strengthen her position in the war. Athens managed to rebuild and regain some semblance of her former supremacy at sea, but in 405 BC, in the Battle of Aegospotami, her dreams were crushed when the Spartans destroyed most of the Athenian fleet. In 404 BC, Sparta dictated the terms of peace and installed an oligarchy, the Thirty Tyrants, in Athens. Under their oppressive regime, most of the shipsheds in the Piraeus, as well as the famed Long Walls, were demolished as part of Athens' disarmament.