Pylos has a continuous historical presence since pre-historic times. The first Messinians arrived in the area in about 3300-3100 B.C. and the land flourished ever since especially in Mycenean times as is apparent from the Palace of Nestor in Eglianos.
There are references about Pylos in Homer and Thucidides as in many other ancient Greek writers.
According to tradition, it was founded by Pylos, son of Klisonas. In the beginning it was called Korifasion, taking its name from the nearby cape. Pylos was conquered in 425 by the Athenian general Demosthenes, while the counter-attack that the Spartans launched with Vrasidas, was not successful, due to the determined defence that the Athenians presented. After the Nikieion Peace, Pylos was under Spartan domination.
The ruined city was reconstructed in 369 B.C. and flourished during the Hellenistic times, when its domination was disputed among the Spartans and the Achaic Conglomeration.
Pylos retained its importance during the Roman and Byzantine eras until the 6th century, when it falls into the hands of the Avars and changes its name to Avarino (from which came the name Navarino). During 1287-1308 the despot of Thebes Nicholas B SaintOmer fortified it with a castle. It was conquerred by the Navarres around 1385, the Enetians in 1417 and in 1500 it fell in the hands of the Turks. The Enetians conquered it again in 1686 and the Turks in 1715.
During the 1821 War of Independence Pylos rebelled under Georgakis and Nikolaos Oikonomidis, with the help of an Eptanisian corps with Merkatis and Maniats under Pierrakos Mavromihalis and a squadron from Spetses and forced the Turks to surrender the castle (August 7, 1821). In 1825 Imprahem occupied the castle and the town and kept it under his command until the sea battle of Navarino, where the allied forces fleets, under Heyden, Codrington and Derigny defeated the Turk-Egypitan armada suffering almost no losses on their side.