At the top of the hill of Old Pyli, on the western part of the Dikaios mountain range and between the villages of Pyli and Lagoudi, you will notice the remains of the Old Pyli fortress that was built in the 11th-12th century. It is the oldest castle of Kos and was inhabited until the beginning of the 19th century. The castle is built of limestone and igneous rock, and the use of bricks is unique in the whole of the Dodecanese. The castle was very well fortified and the inaccessibility of the place protected it from enemy attacks. A settlement was built on its southern side.
The entrance gate was built around the end of the 11th century AD or at the beginning of the 12th century by a byzantine administrator. During the 15th century and under the threat of a Turkish invasion the Castle was often used as a refuge for the people of the area as well as the population of the city of Kos. By 1461 it was the only manned castle left and fortifications were improved while ammunition was accumulated. The castle, however, was seriously damaged by the 1493 earthquake and eventually fell into the hands of the Ottomans in 1523. Parts of the castle were restored by the Ottomans but the area was abandoned in the beginning of the 19th century due to an epidemic. The residents resettled in Asfendiou and Pyli, which were co-administered at the time. Asfendiou consisted of 5 hamlets, namely Lagoudi, Kariotes, Asomatos, Haihoutes and Asfendiou proper, while Pyli consisted of three separate quarters, namely Amaniou, Patriko and Peripatos.
On the NW side of the hill, there was a prehistoric wall dating from the Mycenean period (cyclopean wall) that must have collapsed during an earthquake in the 9th century BC.