During the Medieval age piracy was a big threat for the inhabitants of Santorini. The pirates were often attacking Greek islands when they plundered the crops, enslaved the men and sold the women to harems. The locals decided to defend themselves by building their houses close together on hills separated by narrow streets and high walls. As time went on there were also protection towers built between these walls, from which the people were able to watch the see and prepare for an eventual attack. If a danger was coming, they preserved their crops into big underground pits, locked up their homes and hide themselves in the castle or at some safer place in the inland.
The castle of St. Nicholas dates back to the 15th century. It was one of the most significant residences on the island as it was a home of Byzantine aristocracy as well as high educated people and also a place of storing crops. Later the fortification of the castle was amplified to Ammoudi beach. Unfortunately, the big earthquake in 1956 destroyed its major part so just a fraction of it remained preserved until today. The ruins of the castle can be admired on the north western edge of Oia and because the most amazing view on the sunset is from its walls, it is highly occupied by visitors everyday.source:www.kalimera-greece.eu