The name Pylos is probably a Venetian corruption of Ton Avarinon (Castle of the Avars) which the Byzantines called the old castle, and which later carried over to the newer one. The Venetian occupation was short (1686-1718). The locals call the town Neokastro (new castle) for the citadel that guards the south entrance to the bay, on a promontory above the town, which is the chief one of of the eparchy of Pylia, with around 3000 inhabitants.
The site was not occupied during antiquity, its kastro being built only in 1572 by the Turks, who named it Neokastro to distinguish it from the older one (Palaiokastro) on the north end of the bay. Ibrahim Pasha made it his center of operations in Messenia in 1825, utterly devasting the surrounding area, but he was thrown out by the British, French, and Russians after the famous Battle of Navarino in 1827, the battle that in effect confirmed Greek independence from the Turks during the Greek War of Independence which began in 1821. The Treaty of London (July 1827) had provided that those countries would insure the autonomy of Greece under Turkish rule, with the intention of intimidating the Pasha to withdraw the Turkish and Egyptian fleets from the Peloponnese, but to do so without alienating them. The British admiral was left to his own discretion in this delicate balancing act between a show of force and diplomacy. When told by the Turkish Admiral to leave he responded with " I came to give orders no to take them."