Although long walls were built at several locations in ancient Greece (Corinth and Megara being two of the best known examples) the Long Walls (Greek: Μακρὰ Τείχη) generally refers to the walls built in several phases and connecting Athens to its ports at Piraeus and Phalerum, providing a secure connection to the sea even during times of siege. These walls were of about 6 km in length, were constructed in the mid 5th century BC, destroyed by the Spartans in 403 BC after Athens' defeat in the Peloponnesian War and rebuilt again with Persian support during the Corinthian War. They were a key element of Athenian strategy, since they provided the city with a constant link to the sea and prevented it from being besieged by land alone.
The original city walls of Athens had been destroyed by the Persians during the occupations of Attica in 480 and 479 BC, part of the Greco-Persian Wars. After the Battle of Plataea, the Persian forces that had invaded Greece in 480 BC were removed and the Athenians were free to reoccupy their land and begin rebuilding their city. Early in the process of rebuilding, construction was started on new walls around the city proper. This project drew opposition from the Spartans and their Peloponnesian allies, who had been alarmed by the recent increase in the power of Athens. Spartan envoys urged the Athenians not to go through with the construction, arguing that a walled Athens would be a useful base for an invading army, and that the defences of the isthmus of Corinth would provide a sufficient shield against invaders; however, despite these concerns the envoys did not strongly protest and did in fact give advice to the builders. The Athenians disregarded the arguments, fully aware that leaving their city unwalled would place them utterly at the mercy of the Peloponnesians;Thucydides, in his account of these events, describes a series of complex machinations by by which he distracted and delayed the Spartans until the walls had been built up to such a height as to be defensible.